public static void ThisMain()
        {
            const int hours = 50;
            const int wage  = 70;

            Employee emp = new Employee();

            emp.CalculateWeeklySalary(hours, wage);

            Contractor cont = new Contractor();

            cont.CalculateWeeklySalary(hours, wage);

            Console.ReadLine();
        }
        public static void ThisMain()
        {
            //Different versions of the method are being invoked depending on the object invoking it.
            const int hours = 50;
            const int wage  = 70;

            Employee emp = new Employee();

            emp.CalculateWeeklySalary(hours, wage);

            Contractor cont = new Contractor();

            cont.CalculateWeeklySalary(hours, wage);

            Console.ReadLine();
        }
Beispiel #3
0
        public static void ThisMain()
        {
            const int hours = 50;
            const int wage  = 70;

            Employee emp = new Employee();

            emp.CalculateWeeklySalary(hours, wage);

            Contractor cont = new Contractor();

            cont.CalculateWeeklySalary(hours, wage);

            //cant call private method as it is encapsulated within the class.
            //cont.privateMethod();

            Console.ReadLine();
        }