Sobes.tech
Middle

Is it possible to narrow the access level or change the return type when overriding a method?

sobes.tech AI

Answer from AI

No, you cannot narrow the access level when overriding a method. The access modifier must be the same or more permissive.

The return type when overriding a method can be the same or a subtype of the original type (covariant return types).

Is it possible to narrow the access level or change… - sobes.tech