Multiple choice technology programming languages

In JAVA 1.5, can we have two overridden methods with different return types?

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Java 5 introduced covariant return types, allowing an overriding method to return a more specific subtype than the method it overrides. For example, if a superclass method returns Animal, the subclass override can return Dog (a subclass of Animal).