This code will not give any compilation error in 1.5 . Right ? Because Second is a subclass of First . And in 1.5 you can override method just by change the return type ( ofcourse it should be compatable with original ) .
Is everything is right ? Is this is sufficient for covariant return in beta exam ?
thanks a lot .
posted 12 years ago
Yes, the code above is legal in 1.5 as long as the return type of an overriding method is a subclass of the return type of an overridden method.