Question: Suppose the class Sandwich implements the Edible interface, and you are given the variable declarations Sandwich sub = new Sandwich(); Rectangle cerealBox = new Rectangle(5,
Suppose the class Sandwich implements the Edible interface, and you are given the variable declarations
Sandwich sub = new Sandwich();
Rectangle cerealBox = new Rectangle(5, 10, 20, 30);
Edible e = null;
Which of the following assignment statements are legal?
a. e = sub;
b. sub = e;
c. sub = (Sandwich) e;
d. sub = (Sandwich) cerealBox;
e. e = cerealBox;
f. e = (Edible) cerealBox;
g. e = (Rectangle) cerealBox;
h. e = (Rectangle) null;
Step by Step Solution
3.39 Rating (155 Votes )
There are 3 Steps involved in it
Answer acf lawful statements S... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
2106_60f58f350e703_873122.pdf
180 KBs PDF File
2106_60f58f350e703_873122.docx
120 KBs Word File
