In method overriding, the return type must be the same or a ________ of the superclass overridden method's return type.

  • child
  • different
  • subclass
  • superclass
In Java, when you override a method, the return type of the overriding method must be the same as or a subclass of the return type of the overridden method in the superclass. This is known as covariant return types.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *