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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!