Re-using Base Class Identifiers : Public : Class C# Examples


C# Examples » Class » Public »

 

Re-using Base Class Identifiers









    
class  Point2D
{
        public  int  X;
        public  int  Y;
}
      
class  Point3D  :  Point2D
{
        public  int  X;
        public  int  Y;
        public  int  Z;
}
      
class  MyMainClass
{
        public  static  void  Main()
        {
                Point2D  My2DPoint  =  new  Point2D();
                Point3D  My3DPoint  =  new  Point3D();
      
                My2DPoint.X  =  100;
                My2DPoint.Y  =  200;
      
                My3DPoint.X  =  150;
                My3DPoint.Y  =  250;
                My3DPoint.Z  =  350;
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Class
» Public