Re-using Base Class Identifiers : public « Class « C# / CSharp Tutorial






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;
    }
}








7.17.public
7.17.1.Public vs private access
7.17.2.Use an access modifier with an accessor
7.17.3.Re-using Base Class Identifiers