There is a minor correction in the first method overriding rule specified in the previous lecture. Below is the rule where we are saying that the return types have to be compatible. This is applicable only to non-primitive return types and not primitive return types. For example, if super class method returns User, then subclass method can return Staff. However, if the return type of super class method is primitive type, then the subclass method MUST also have the same return type. So, if it is int in super class, then it must be int in subclass too and not anything else like byte, short, etc.
Rule 1: Same parameters + compatible return types
So, rule can be defined as follows:
Same parameters + same or compatible (only for non-primitive) return types