Given the following class and reference declarations, what can be said about the statement y = (Sub)

Question:

Given the following class and reference declarations, what can be said about the statement y = (Sub) x?

image text in transcribed

Select the one correct answer.

(a) It is illegal at compile time.

(b) It is legal at compile time, but might be illegal at runtime.

(c) It is definitely legal at runtime, but the cast operator (Sub) is not strictly needed.

(d) It is definitely legal at runtime, and the cast operator (Sub) is needed.

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

Step by Step Answer:

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