Sreekanth Reddy

Sreekanth Reddy

  • 353
  • 4.8k
  • 421.4k

Interface

Sep 25 2013 12:43 AM
 interface Ij
    {
        void m();
    }
    class h : Ij
    {
        public void i()
        {
            Console.WriteLine("iiii");
        }
        public void m()
        {
            Console.WriteLine("mm");
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            h obj = new h();
            obj.i();
            obj.m();
            Console.ReadLine();
        }


In the above Interface program why we need to go for Interface "Ij" ? Directly we can go for "h" know? and that too we cannot create object for interface... what is it's purpose?            Please explain me friends....................... I am a learner.

Answers (3)