posted 14 years ago
class Animal{}
class Gerbil extends Animal{}
class Vet{
Can somebody explain how check covariant return type as what i understand is
In line 7
Gerbil is the subclass so covariant return type is ok..but what to chek in the return type as return tyoe in line 7 is "return new Gerbil()" How does return type(return new Gerbil()) is related to "Gerbil go()"
as it says line 9 is wrong? I am a bit confused, so please give example to make me understand