---
title: "What is the name_space and nested Name_Space in C#?"  
description: "What is the name_space and nested Name_Space in C#?"  
author: "Abhishek Srivasatava"  
published: 2016-09-20  
updated: 2020-09-20  
canonical: https://www.mindstick.com/interview/23048/what-is-the-name_space-and-nested-name_space-in-c-sharp  
category: "c#"  
tags: ["c#", "nested"]  
reading_time: 2 minutes  

---

# What is the name_space and nested Name_Space in C#?

## Namespaces

As the name suggests, name-space is designed to differentiate the one set of names from another. With the help of namespace we can organize our program by making a group of classes, delegates, interfaces, enumerations or structures.

**Example :**

```
namespace MindStick{          public
class demo           {                   public
int demo1()                    {                   return
1;                   }          }                 }
```

**Nested name_space**

Below is the example to represent Nested Namespace

```
namespace Name_Demo{          class Program          {                   public int demo1()                   {                             return 1;                   }           }          namespace n3           {                   using Name_Demo;                   class b:Program                    {                                      static void Main(string[] args)                                       {                                        }                       }           }}
```

\

For more details click here: [Namespace](https://www.mindstick.com/Articles/28/namespace-in-dot-net), [Namespace and Class](https://www.mindstick.com/blog/681/namespace-and-class) \
\

\

## Answers

### Answer by Abhishek Srivasatava

## Namespaces

As the name suggests, name-space is designed to differentiate the one set of names from another. With the help of namespace we can organize our program by making a group of classes, delegates, interfaces, enumerations or structures.

**Example :**

```
namespace MindStick{          public
class demo           {                   public
int demo1()                    {                   return
1;                   }          }                 }
```

**Nested name_space**

Below is the example to represent Nested Namespace

```
namespace Name_Demo{          class Program          {                   public int demo1()                   {                             return 1;                   }           }          namespace n3           {                   using Name_Demo;                   class b:Program                    {                                      static void Main(string[] args)                                       {                                        }                       }           }}
```

\

For more details click here: [Namespace](https://www.mindstick.com/Articles/28/namespace-in-dot-net), [Namespace and Class](https://www.mindstick.com/blog/681/namespace-and-class) \
\

\


---

Original Source: https://www.mindstick.com/interview/23048/what-is-the-name_space-and-nested-name_space-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
