31.Multilevel_Inheritance
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Multilevel_Inheritance.cs
{
class parent
{
public void show()
{
Console.WriteLine("This is Parent Class");
}
}
class child1 : parent
{
public void show1()
{
Console.WriteLine("This is child1 Class");
}
}
class child2 : child1
{
public void show2()
{
Console.WriteLine("This is child2 Class");
}
}
class Program
{
static void Main(string[] args)
{
child2 obj = new child2();
obj.show();
obj.show1();
obj.show2();
Console.Read();
}
}
}
Comments
Post a Comment