using System;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
namespace App6
{
classProgram
{
staticvoid Main(string[] args)
{
Console.WriteLine("Object of class D is created.");
Dd = newD();
Console.WriteLine("Object of class C is created.");
Cc = newC();
Console.ReadLine();
}
}
classA
{
public A()
{
Console.WriteLine("Class A");
}
}
classB : A
{
public B()
{
Console.WriteLine("Class B");
}
}
classC : B
{
public C()
{
Console.WriteLine("Class C");
}
}
classD : B
public D()
{
Console.WriteLine("Class D");
}
}
}
|
OUTPUT: Object of class D is created. Class A Class B Class D Object of class C is created. Class A Class B Class C |
No comments:
Post a Comment