C# Inheritance Program
class test{
public void show()
{
Console.WriteLine("\nTest Calss");
}
}
class rest : test
{
public void print()
{
Console.WriteLine("\nRest Class");
}
}
class Program
{
static void Main(string[] args)
{
test ob = new test();
rest ob2 = new rest();
ob.show();
ob2.print();
ob2.show();
}
}
Next Topic
No comments:
Post a Comment