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?
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
Programmers Guide To Java SE 8 Oracle Certified Associate OCA
ISBN: 9780132930215
1st Edition
Authors: Khalid Mughal, Rolf Rasmussen
Question Posted: