Inherit multiple interfaces in C#.NET

Is it possible to inherit multiple interfaces in C#.NET?

Yes

Interface contains all abstract methods. Classes and Structs inherits it and provide an implementation for each interface member declared.

The keyword interface creates an interface. They are public by default.

Multiple Inheritance in C# is possible using interface which contains all abstract methods. The implementation for each interface member are done in the class inherited it.

Example

using System;
interface abc
{
   void Display();
}
interface xyz
{
   void Display();
}
class Test : abc, xyz
{
   void abc.Display()
   {
      Console.WriteLine("");
   }
}
How to prevent your class from being inherited? - C#.NET
C#.NET - How to prevent your class from being inherited? - You can do so by declaring the class public and making the method sealed...
When do we declare a class as abstract in C#.NET?
C#.NET - When do we declare a class as abstract in C#.NET? - When at least one of the methods in the class is abstract...
How can you overload a method? - C#.NET
C#.NET - How can you overload a method? - Different parameter data types, different number of parameters, different order of parameters...
Post your comment