Suppose that the class Mystery is derived from the class Secret. Consider the following statements. Secret mySecret = new Secret() ; Secret secRef; Mystery myMystery = new Mystery() ; Mystery mysRef; secRef = myMystery; Which of the following statements is legal in Java? (i) mysRef = (Mystery) mySecret; (ii) mysRef = (Mystery) secRef;
A) Only (i)
B) Only (ii)
C) Both (i) and (ii)
D) None of these
Correct Answer:
Verified
Q40: An abstract method is a method that
Q41: An abstract class _.
A) does not have
Q42: Composition is also called _.
A) inheritance
B) aggregation
C)
Q43: The classes Reader and Writer are derived
Q44: An abstract method _.
A) is any method
Q45: An abstract class can contain _.
A) only
Q46: Which operator is used to determine if
Q47: If a class implements an interface, it
Q49: Suppose that the class Mystery is derived
Q50:
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents