C# program for Multilevel Inheritance
Program.cs
GreenBank gb = new GreenBank();
gb.GreenBankBonus();

class Bank
{
    public void Bonus()
    {
        Console.Write("Festival Bonus: ");
    }
}
class WhiteBank : Bank
{
    public void WhiteBankBonus()
    {
        base.Bonus();
        Console.WriteLine("WhiteBank 1500");
    }
}
class GreenBank : WhiteBank
{
    public void GreenBankBonus()
    {
        base.WhiteBankBonus();
        base.Bonus();
        Console.Write("GreenBank 500");
    }
}
Output
kodingwindow@kw:~/csharp$ dotnet run
Festival Bonus: WhiteBank 1500
Festival Bonus: GreenBank 500
kodingwindow@kw:~/csharp$ 
Advertisement