1. Engineering
  2. Computer Science
  3. from java for everyone late objects review excercises r914suppose...

Question: from java for everyone late objects review excercises r914suppose...

Question details

From Java for Everyone, late objects - Review Excercises R9.14Suppose 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;

Any ideas on this?

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution