Overriding Tutorial

Rule for overriding: 1) In overriding method signature must be matched in both super and sub class. 2) Co-variant return type: Child class method return type should need not be same as super class method return type. Its child classes are allowed. Example:

This is valid from java 1.5

Co-variant return type rule is […]