Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 1 Forum
Date: Fri Sep 7 2001 9:20 am
Author: Lee, Peter <petel@cmu.edu>
Subject: Re: toString()

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.
Post response

Go to the previous messageGo to the following message
Current Thread Detail:
toString()      Jirawongkraisorn, Sittan P.      Fri Sep 7 2001 12:41 am       
Re: toString()      Lee, Peter      Fri Sep 7 2001 9:20 am       
Re: toString()      Chen, Richard      Fri Sep 7 2001 1:37 pm       

Back to previous screen