Using a Namespace Directive : Namespace Alias : Language Basics C# Examples


C# Examples » Language Basics » Namespace Alias »

 

Using a Namespace Directive









    
using  System;
      
using  Class1  =  Namespace1.TestClass;
using  Class2  =  Namespace2.TestClass;
      
namespace  Namespace1
{
        class  TestClass
        {
                public  TestClass()
                {
                        Console.WriteLine("Hello  from  Namespace1.TestClass!");
                }
        }
}
      
namespace  Namespace2
{
        class  TestClass
        {
                public  TestClass()
                {
                        Console.WriteLine("Hello  from  Namespace2.TestClass!");
                }
        }
}
      
class  MainClass
{
        public  static  void  Main()
        {
                Class1  Object1  =  new  Class1();
                Class2  Object2  =  new  Class2();
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Language Basics
» Namespace Alias