Question: In Java I have this toString() method.... Please explain this code briefly.... why is the return value calling toString() again? - In which cases do
In Java I have this toString() method.... Please explain this code briefly....
why is the return value calling toString() again?
- In which cases do you make the method call itself again just like how this toString() method called toString() again in the return ?
Thanks
public String toString() {
StringBuffer sb = new StringBuffer(); for(Card c: cards) { sb.append(c + " "); }
return sb.toString(); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
