Wednesday, May 31, 2006

Difference: toString & System.out.println()

Remember that whenever you pass an object to the System.out.println() method, the object’s toString() method is automatically called. Because of polymorphism, this method is always called on the runtime type of the object, which in this case is a String.

0 Comments:

Post a Comment

<< Home