Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
POJO + toString()
kri shan
Ranch Hand
Posts: 1491
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Why do we need to implement toString() in the POJO class ?
Steve Luke
Bartender
Posts: 4179
22
I like...
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
kri shan wrote:
Why do we need to implement toString() in the POJO class ?
Define 'need to.' You can compile and run classes that do not override the toString() method. You you don't need to.
Why should you? Well, what does the toString() do?
Campbell Ritchie
Marshal
Posts: 79178
377
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Foo f = new Foo(...); . . . System.out.println(f);
Try that sort of code, and the answer will become obvious.
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
returning multiple values in a web service
JSF Question
Getting a reference to a JMS Queue defined in JBoss AS 7
Serializble class + toString()
Dynamically create a class at runtime
More...