Re: question about the toString Method




You call
System.out.println(myCourse), which calls
String.valueOf(myCourse), which calls
myCourse.toString(), which returns a String to
String.valueOf(myCourse), which returns the same String to
System.out.println(myCourse), which then calls
System.out.print(theString), which returns to
System.out.println(myCourse), which eventually returns to
You.

--
Eric Sosman
esosman@xxxxxxxxxxxxxxxxxxxx

Thanks Eric,

I think I follow what you're saying. My Java intermediate course is
starting in a couple of weeks. I'm wondering at what point concepts like
this are introduced. Is this a graduate level understanding? The text by
Tony Gaddis, Starting out with Java, is pretty good, but it drives me crazy
when he leaves out explanations of this type. I'm wondering whether it's
better just to accept what's happening, at my level, or to dig deeper. I
definitely feel that sometimes the ideas have to sit for awhile before they
just seem to gell.

Thanks again

This was pretty clear.

Art


.