Question
1) What will be the output of the following code? public class Employee ( public void pay() ( work (); System.out.print(paying salary ); public
1) What will be the output of the following code? public class Employee ( public void pay() ( work (); System.out.print("paying salary "); public void work () { System.out.print("working "); } 1 public class HourlyEmployee extends Employee ( public void pay () { super.pay(); System.out.print(" Hourly Employee"); The following statement appears in the Test class. What will be displayed as output on the screen? HourlyEmployee emp= new HourlyEmployee (); emp. pay(); a) working paying salary Hourly Employee b) paying salary Hourly Employee c) working Hourly Employee d) working paying salary e) Hourly Employee nerated using the
Step by Step Solution
There are 3 Steps involved in it
Step: 1
The detailed answer for the above question is provided below The cor...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started