Single Interface - C# .NET


All interfaces should be declared with the keyword interface. You can implement any number of interfaces in a single derived class, but you should provide signatures to all method definitions of the corresponding interfaces.
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
    class Program
    {
        interface inter
        {
            void show();
        }
        class interimp : inter
        {
            public void show()
            {
                System.Console.WriteLine("show() method implemented");
                System.Console.Read();
            }
            static void Main(string[] args)
            {
                interimp interp = new interimp();
                interp.show();
            }
        }
    }
}

OUTPUT:

Contact Us

Name

Email *

Message *

Blog Archive

Popular posts