Re: question about the toString Method
- From: Chase Preuninger <chasepreuninger@xxxxxxxxx>
- Date: Sun, 30 Dec 2007 17:03:23 -0800 (PST)
Well if it doesnt call the toString method, what the hell is
System.out going to know what to print. It calls the toString because
it is always there, since it is inherited from object. Since you
overrode that method in your class System.out calls it to get the
string representation. If you want to see what the toString method
would display if you dident override it, simply don't override it, or
return super.toString(). And if you want both implementations, make a
separate getter method for either on of them.
.
- Follow-Ups:
- Re: question about the toString Method
- From: Chase Preuninger
- Re: question about the toString Method
- References:
- question about the toString Method
- From: Art Cummings
- question about the toString Method
- Prev by Date: Re: Extremely slow when accessing file browsing dialog
- Next by Date: Re: question about the toString Method
- Previous by thread: Re: question about the toString Method
- Next by thread: Re: question about the toString Method
- Index(es):