C# program for Single Inheritance
Program.cs
WhiteBank wb = new WhiteBank();
//wb.Bonus();
wb.WhiteBankBonus();

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