Suppose the class Sub extends the class Sandwich. Which of the following assignments are legal? Sandwich x

Question:

Suppose the class Sub extends the class Sandwich. Which of the following assignments are legal?

Sandwich x = new Sandwich();
Sub y = new Sub();
a. x = y;
b. y = x;
c. y = new Sandwich();
d. x = new Sub();

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: