Covariant Return Types In Java
As we already know what method overriding is, the subclass providing new implementation of the super class method provided that the method signature in subclass should exactly match with method signature of super class including the return types. The covariant return types are newly introduced since Java 5.0, and used during method overriding. Covariant return type allows us to change the return type of the overriding method in the subclass; however this return type in subclass method must be a subtype of super class method return type. Also Check: Java Interview Questions and Answer Simply put, overriding method (in subclass) […]
Covariant Return Types In Java Read More »