In String toString()
method returns this
and when i pass it System.out.println()
it prints the content of the String
. It is confusing for me how is that happening. can comeone explain please.
public String toString() {
return this;
}
Thanks.
See Question&Answers more detail:os