Good question. Actually, in Java, when it is clear from context that an object must be coerced into a String representation, a call to the object's toString() method is made automatically.
So, you are right that you can't print a Node object. But attempts to do so will cause Java to invoke Node's toString method.
|