3
Answers

Interface

Srikanth Reddy

Srikanth Reddy

11y
940
1
 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)