Constuctor hidden : Constructor : Class C# Examples


C# Examples » Class » Constructor »

 

Constuctor hidden









    
using  System;

public  class  Class1  {
        public  static  void  Main(string[]  args)  {
                SubClass  sc1  =  new  SubClass();
                SubClass  sc2  =  new  SubClass(0);
        }
}

public  class  BaseClass  {
        public  BaseClass()  {
                Console.WriteLine("Constructing  BaseClass  (default)");
        }
        public  BaseClass(int  i)  {
                Console.WriteLine("Constructing  BaseClass  (int)");
        }
}

public  class  SubClass  :  BaseClass  {
        public  SubClass()  {
                Console.WriteLine("Constructing  SubClass  (default)");
        }
        public  SubClass(int  i)  {
                Console.WriteLine("Constructing  SubClass  (int)");
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Class
» Constructor