So in this case if the method only returns Banana, it will go wrong;
You have four cases to resolve, means method must return what is passed
to it. So how to do so
That is why if you write:
return s; //Always true
//Because what is S can simply be returned because return type of the
method is S. Forget what is S (Apple,Banana,Orange,Fruit), if you simply return s, it will do
And let us come to null (I think you understand it better);
Anyways,
null can be assigned to any type of reference variable, so therefore returning null has no botheration.
cmbhatt
cmbhatt
cmbhatt
cmbhatt
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |