How to achieve Multiple Inheritance in C# using interfaces
Program.cs
Bank b=new Bank();
b.WhiteBankBonus();
b.GreenBankBonus();

interface IWhiteBank
{
    void WhiteBankBonus();
}
interface IGreenBank
{
    void GreenBankBonus();
}
class Bank : IWhiteBank, IGreenBank
{
    public void WhiteBankBonus()
    {
        Console.WriteLine("WhiteBank Festival Bonus: 1500");
    }
    public void GreenBankBonus()
    {
        Console.Write("GreenBank Festival Bonus: 500");
    }
}
Output
kodingwindow@kw:~/csharp$ dotnet run
WhiteBank Festival Bonus: 1500
GreenBank Festival Bonus: 500
kodingwindow@kw:~/csharp$ 
What Next?
C# Namespaces
Advertisement