C# How to make interface using multilevel inheritance

using System;

namespace @interface
{
    interface ifirst
    {
         void name();
    }
    interface isecond
    {
      void sec();
   
    }
    class show:ifirst,isecond  {
       void ifirst.name()
        {
        Console.WriteLine("STUDENT NAME IS Jhon");
       
        }
    void isecond.sec(){
   
    Console.WriteLine("SEC - C 2017");
   
    }
 
    }

    class demo{
        static void Main(string[] args)
        {

            show obj1 = new show();
            ((ifirst)obj1).name();
            ((isecond)obj1).sec();
            Console.ReadKey();
        }
    }

}

OUTPUT




No comments:

Post a Comment