How to achieve Multiple Inheritance in C# using interfaces
Program.cs
Bankb=newBank();b.WhiteBankBonus();b.GreenBankBonus();interfaceIWhiteBank{voidWhiteBankBonus();}interfaceIGreenBank{voidGreenBankBonus();}classBank:IWhiteBank,IGreenBank{publicvoidWhiteBankBonus(){Console.WriteLine("WhiteBank Festival Bonus: 1500");}publicvoidGreenBankBonus(){Console.Write("GreenBank Festival Bonus: 500");}}
Output
kodingwindow@kw:~/csharp$ dotnet run
WhiteBank Festival Bonus: 1500
GreenBank Festival Bonus: 500
kodingwindow@kw:~/csharp$
Dear User, Thank you for visitng Kodingwindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.
Dear User, We are grateful for your interest in the Kodingwindow Android app. We intend to soon make it available on the Google Play Store. Currently, Android versions 10 and up require manual apk installations. Would you like to get the app?