Beispiel #1
0
        static void Main(string[] args)
        {
            IQuittable object1 = new Employee();
            //person.
            Employee employee = new Employee();//instantiation for use

            employee.firstName = "Deepak";
            employee.lastName  = "Bandhu";

            object1.Quit(employee);
            Console.WriteLine(employee.firstName + " " + employee.lastName);
            Console.ReadLine();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            //instantiate an object and give values to its attributes
            Employee employee = new Employee()
            {
                firstName = "Sample", lastName = "Student"
            };

            employee.SayName();
            //Use polymorphism to create an object of type IQuittable and call the Quit() method on it
            IQuittable quittable = new Employee();

            quittable.Quit(employee);
            Console.ReadLine();
        }