class plant
{
plant getType() {return this;}
}
class flower extends Plant{ //insert code here}
class tulip extends flower{}
which will compile inserted at //insert code here ?
A. flower getType(){return this;}
B.
String getType(){return this;}
C. Plant getType(){return this;}
A. tulip getType(){return new tulip();}
Answer in K&B is A , C and D are true
I am sure about A and C but not sure about tulip...
as per the polimorphism we can return super type of flower i.e plant or flower itself , but how can we sent value of its subclass ?
Thank you
Nikesh