We are providing online training of realtime Live project on Asp.Net MVC with Angular and Web API. For more information click here. If you have any query then drop the messase in CONTACT FORM

Monday, June 22, 2015

1   Write a program to create an ‘Employee’ class (Base) with the public Show() method. Create ‘SalaryEmployee’ class (Derived) with Display() method which should internally call the Show() method of Employee class. Show the methods’ content using class objects in the Console application.
        class Program
    {
        public class Employee
        {
            public void show()
            {
                Console.WriteLine("Display the show method");
            }
        }
         public class SalaryEmployee : Employee
        {
            public void Display()
            {
                Console.WriteLine();
                Console.WriteLine("This Display method and internally call to show method");
                Console.WriteLine();
                 show();
            }
        }
        static void Main(string[] args)
        {
            SalaryEmployee SE = new SalaryEmployee();
            SE.show();
            SE.Display();
            Console.ReadLine();
        }
     }
    OUTPUT:

No comments: