Answered step by step
Verified Expert Solution
Question
1 Approved Answer
B. Given that HourlyEmployee and SalariedEmployee are subclasses of FullTimeEmployee, suppose we have: FullTimeEmployee fullnew FullTimeEmployee(); HourlyEmployee hourly- new HourlyEmployee(0; SalariedEmployee salaried- new SalariedEmployee); Which
B. Given that HourlyEmployee and SalariedEmployee are subclasses of FullTimeEmployee, suppose we have: FullTimeEmployee fullnew FullTimeEmployee(); HourlyEmployee hourly- new HourlyEmployee(0; SalariedEmployee salaried- new SalariedEmployee); Which one of the following assignments would be legal at (i) compile-time and/or (ii) run time? a. salaried = (SalariedEmployee) full; b, salaried= full; c. salaried= (FullTimeEmployee) full; d, hourly= (HourlyEmployee) full; write your answers below: C. d. Create Java code with the above statements to validate your answers. ( write a simple Class with main
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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