AbstractClasses, Upcasting, Downcasting—TheProductionHierarchy
Determine which of the following lines generates an error. Use the Production hierarchy of this chapter. In each case, explain the cause of the error.
a. Production p = new Musical("Sweeny Todd", "Harold Prince", "Hugh Wheeler", "Stephen Sondheim", " Stephen Sondheim", 557);
b. Production p = new Production();
c. Musical m = new Film();
d. Musical m = new Musical();
e. Play p = new Musical(); p.getDirector(); (Musical) p.getComposer();
f. Film play = new Musical();
g. Production p = new Musical(); p.getDirector(); (Play) p.getDirector(); (Play) p.getComposer();
h. Comparable c = new Musical(); Film f = new Musical(); c.compareTo(f);
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.