posted 15 years ago
As vierda was talking about covariant returns, the return type of a method in subclass should be subclass of the return type of the method in the super class. Animal is a super class of cat so it works fine, but int is not a super class of long.