Question: 3.4: In what cases does polymorphism work correctly for the lines below? Explain why or why not for each line. Employee e0 = new Employee

3.4: In what cases does polymorphism work correctly for the lines below? Explain why or why not for each line.

Employee e0 = new Employee ("Gullible Gus", "555-55-5678", 50000); Employee e1 = new Customer ("Gullible Gus", "555-55-5678", 5); Employee e2 = new Person("Zany Zoe", "112-12-1212"); Person p1 = new Customer ("Gullible Gus", "555-55-5678", 5); Person p2 = (Person) e0; Customer c1 = (Person) p1; Customer c2 = p1; Person p3 = (Employee) e0; Person p4 = e0; // note, in the original version of this page this said p3 = ...

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!