Using covariant returns when overriding a method. (enthuware.ocajp.i.v8.2.1145)

Share this & earn $10
Published at : September 19, 2021

In this video we are asked which methods correctly override the method in the parent class. Covariant returns, where we return a subtype in the overriding method applies; providing you are returning a type and not a primitive. In addition, you must not reduce the visibility of the method when overriding. Using covariant returns when overriding a method. (enthuware.ocajp.i.v8.2.1145)
Usingcovariantreturns