Wednesday, 20 November 2013

Simple program of interface by explicit way

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplicationinterface
{
   public interface IsampleInterface
    {
       void sampleMethod();
   }
    class program : IsampleInterface
    {
        void IsampleInterface.sampleMethod()
        {
            Console.WriteLine("example of interface");
        }
   


       public static void Main(string[] args)
       {
IsampleInterface rect = new program();
           rect.sampleMethod();
           Console.ReadKey();
       }
   }
}

Output:


No comments:

Post a Comment