Jeet Dholakia wrote:some advanced uses like the one below confuse me
You're probably thinking it's something more complicated than it really is. Let's look at it this way.
Every class has an instance method
toString(), inherited from
Object and in many cases overridden in the class or a superclass to return a
String that reveals useful information about the instance. Now consider the
String class. What's the
most appropriate value to return from
toString()? Why, the
String itself!
And in fact that's what the method does. From the source (which you can find in
src.zip in your JDK installation folder):