Use the global alias. : Namespace Alias : Language Basics C# Examples


C# Examples » Language Basics » Namespace Alias »

 

Use the global alias.









    
using  System;    
    
using  Ctr  =  Counter;    
  
namespace  Counter  {    
    class  MyClass  {    
    }    
}    
    
//  Declare  another  class  called  CountDown,  which    
//  is  in  the  global  namespace.    
class  MyClass  {  
}  
  
class  GlobalAliasQualifierDemo  {    
    public  static  void  Main()  {    
  
        Ctr::MyClass  m  =  new  Ctr::MyClass();    
  
        //  Next,  create  CountDown  object  from  global  namespace.  
        global::MyClass  m2  =  new  global::MyClass();    
    }    
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Language Basics
» Namespace Alias