Given that HourlyEmployee and SalariedEmployee are subclasses of FullTimeEmploye
ID: 3709048 • Letter: G
Question
Given that HourlyEmployee and SalariedEmployee are subclasses of FullTimeEmployee, suppose we have: FullTimeEmployee fullnew FullTimeEmployee(); HourlyEmployee hourlynew HourlyEmployee (); SalariedEmployee salaried new SalariedEmployee (: full salaried Which one of the following assignments would be legal both at compile time and at run-time? a. salaried (SalariedEmployee) full; b salaried-full c. salaried-(FullTimeEmployee) full; d. hourly-HourlyEmployee) full; Create a small project to validate your claim.Explanation / Answer
Answer: a. salaried = (SalariedEmployee) full;
salaried = (SalariedEmployee) full; is the legal both at compile and runtime
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.