Hi there,
this is a excerpt taken from book of kathy page:168 Q.No 8
class Plant{
String getName(){return "plant";}
Plant getType(){return this;}
}
class Flower extends Plant{
Tulip getType(){return new Tulip();}
}
class Tulip extends Flower{}
My question: is third last statement Tulip getType(){return new Tulip();} is co-variant return? If so, clarify me what does Co-variant return mean? Does this program compile?