Solved

Suppose That the Class Mystery Is Derived from the Class

Question 5

Multiple Choice

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions