c#,multilevel,inheritance

Omar 8/9/2016 0

This Code Demonstrate Multilevel Inheritance

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Inherit
{
    class inheri : vehicle
    {
        public void Noise()
        {
            Console.WriteLine("All Vehicles Creates Noise !! ");
        }
        static void Main(string[] args)
        {
           inheri obj = new inheri();
            obj.mode();
            obj.feature();
            obj.Noise();
            Console.Read();
        }
    }
    class Mode
    {
        public void mode()
        {
            Console.WriteLine("There are Many Modes of Transport !!");
        }
    }
    class vehicle : Mode
    {
        public void feature()
        {
            Console.WriteLine("They Mainly Help in Travelling !!");
        }
    }
} 


/*
Here is the output of the C# Program: There are Many Modes of Transport !! They Mainly Help in Travelling !! All Vehicles Creates Noise !!
*/

Report Bug

Please Login to Report Bug

Reported Bugs

Comments

Please Login to Comment

Comments