C# program to implement multi level inheritance.

Prabhukiran345
Posted by Prabhukiran345 under C# category on | Points: 40 | Views : 5754
This program demonstrates how base class constructors are inherited using multilevel inheritance.
using System;
namespace Inherit
{
class Shape
{
public Shape()
{
Console.WriteLine("Constructor of base class Shape");
}
}
class Polygon : Shape
{
public Polygon()
{
Console.WriteLine("Constructor of Base class Polygon");
}
}
class Quad : Polygon
{
public Quad()
{
Console.WriteLine("Contructor of class Quad");
}
public static void Main(string[] args)
{
Quad obj= new Quad();
}
}
}


Output
Constructor of base class Shape
Constructor of Base class Polygon
Contructor of class Quad

Comments or Responses

Login to post response