CSharp - Implement two or more interfaces

Description

Implement two or more interfaces

Demo

using System;

interface IMyInterface3A
{
    void Show3A();
}
interface IMyInterface3B
{
    void Show3B();
}
class MyClass3 : IMyInterface3A, IMyInterface3B
{
    public void Show3A()
    {/*from   w  ww.  j a  v a  2  s . c o  m*/
        Console.WriteLine("MyClass3 .Show3A() is completed.");
    }
    public void Show3B()
    {
        Console.WriteLine("MyClass3 .Show3B() is completed.");
    }
}
class Program
{
    static void Main(string[] args)
    {
        MyClass3 myClassOb = new MyClass3();
        myClassOb.Show3A();
        myClassOb.Show3B();
    }
}

Result

Related Topic