Hi,
I came across a question, and was unable to understand the solution for the question.
Here it is..
Given:
Which statement(s), inserted at line 7, will compile? (Choose all that apply.)
A. Flower getType() { return this; }
B.
String getType() { return "this"; }
C. Plant getType() { return this; }
D. Tulip getType() { return new Tulip(); }
The answer is A,C, and D.
and B is incorrect.
However i want to know WHY B is incorrect?