44 lines
853 B
C#
44 lines
853 B
C#
|
/*
|
||
|
* C# Program to Demonstrate Multilevel Inheritance
|
||
|
*/
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Text;
|
||
|
namespace Inherit
|
||
|
{
|
||
|
class inheri : vehicle
|
||
|
{
|
||
|
public void Noise()
|
||
|
{
|
||
|
Console.WriteLine("All Vehicles Creates Noise !! ");
|
||
|
}
|
||
|
static void Main(string[] args)
|
||
|
{
|
||
|
inheri obj = new inheri();
|
||
|
obj.mode();
|
||
|
obj.feature();
|
||
|
obj.Noise();
|
||
|
Console.Read();
|
||
|
}
|
||
|
}
|
||
|
class Mode
|
||
|
{
|
||
|
public void mode()
|
||
|
{
|
||
|
Console.WriteLine("There are Many Modes of Transport !!");
|
||
|
}
|
||
|
}
|
||
|
class vehicle : Mode
|
||
|
{
|
||
|
public void feature()
|
||
|
{
|
||
|
Console.WriteLine("They Mainly Help in Travelling !!");
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
There are Many Modes of Transport !!
|
||
|
They Mainly Help in Travelling !!
|
||
|
All Vehicles Creates Noise !!
|