| Author |
overriding toString()
|
Surya Bavirti
Greenhorn
Joined: Sep 08, 2008
Posts: 13
|
|
|
why programmeres overriding toString() method? where it is really usefull in projects?.i have seen this a lot of times in java examples.
|
 |
Sagar Rohankar
Ranch Hand
Joined: Feb 19, 2008
Posts: 2896
|
|
"toString" in one shot gives you a short description about an object !! It may print an important state of your object, which comes handy in displaying an object . If your printing some objects , you can show some user understandable message by overriding 'toString()' method, rather than printing its hashcode values !
|
[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
|
 |
 |
|
|
subject: overriding toString()
|
|
|