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());}}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here