Asked by Caitlyn Hopkins on Jul 07, 2024

verifed

Verified

Suppose that the class Mystery is derived from the class Secret. The following statements are legal in Java.Secret secRef;
Mystery mysRef = new Mystery();
secRef = mysRef;

Legal

Pertaining to the system of laws within a particular country, state, or community.

Superclass

A class from which other classes inherit methods and variables; also known as the parent class.

  • Understand the employment and guidelines of polymorphism in the context of Java programming.
  • Gain insight into the rudimentary mechanisms of inheritance in Java.
verifed

Verified Answer

ZK
Zybrea KnightJul 09, 2024
Final Answer :
True
Explanation :
Since a derived class object can be treated as a base class object, it is legal to assign a Mystery object to a Secret reference variable.