Friday, 1 September 2017

C# programming tutorial to implement the use of Multilevel Inheritance

C# program example to use of Multilevel Inheritance in C# program

Program

using System;
    class A     {
        public void print()
        {
            Console.WriteLine("Class A");
        }
     }
      class B : A
    {
        public void print1()
        {
            Console.WriteLine("Class B");
        }
    }
     class C : B
    {
        public void print2()
        {
            Console.WriteLine("Class C");
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            C b = new C();
             b.print();
            b.print1();
            b.print2();
        }

    } 

Output


0 comments:

Post a Comment