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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…