WHAT IS THE NAME_SPACE AND NESTED NAME_SPACE IN C#?

Abhishek Srivasatava

Total Post:70

Points:350
Posted by  Abhishek Srivasatava
C#  Nested 
C#
 249  View(s)
Ratings:
Rate this:
  1. Abhishek Srivasatava

    Post:70

    Points:350
    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: NamespaceNamespace and Class 


      Modified On Sep-20-2016 05:48:52 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!