Wednesday 27 July 2016

C Sharp Overriding Tutorial

C# Overriding Program

 class test
    {
        public void show()
        {
            Console.WriteLine("\nInside of test class\n");
        }
    }
    class best : test

    {
        public void show()
        {
            Console.WriteLine("\nInside of Best Class\n");
        }
        public void local()
        {
            Console.WriteLine("\nI am local Funtion of Best Class");
        }
    }
    class rest : test
    {
        public void show()
        {
            Console.WriteLine("\nInside of Rest class\n");
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            test ob=new test();
            ob.show();
            ob = new best();
            ob.show();              
            ob = new rest();
            ob.show();
        }
    }

No comments:

Post a Comment