Is the following program legal? The relevant classes are defined in Displays 7.2, 7.3, and 7.5. public class EmployeeDemo { public static void main(String[] args) { HourlyEmployee joe = new...


Is the following program legal? The relevant classes are defined in Displays 7.2,
7.3, and 7.5.
public class EmployeeDemo
{
public static void main(String[] args)
{
HourlyEmployee joe =
new HourlyEmployee("Joe Young",
new Date("February", 1, 2015), 10.50, 40);
SalariedEmployee boss =
new SalariedEmployee("Mr. Big Shot",
new Date("January", 1, 2015), 100000);
printName(joe);
printName(boss);
}
public void printName(Employee object)
{
System.out.println(object.getName());
}
}



Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here