/* C# program to implemmet multi level inheritance.
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
Saturday, June 14, 2008
Subscribe to:
Post Comments (Atom)
2 comments:
don't put whole programs, jus put the particular code
don't put whole programs, jus put the particular code
Post a Comment