This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Turning an int into a String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Turning an int into a String" Watch "Turning an int into a String" New topic

Turning an int into a String

Mike Fourier

Joined: Apr 02, 2008
Posts: 25
So I've inherited a codebase. And pretty much everywhere that an object returns an int, where a String is desired, I find code like this:

Is there some sort of advantage to that code, that I don't understand? I mean: why not just this:

Paul Clapham

Joined: Oct 14, 2005
Posts: 18541

It's possible that the advantage was simply that the original programmer knew how to write that code but didn't know how to write your suggested replacement.
wood burning stoves
subject: Turning an int into a String
Similar Threads
autoincrement invoice
View several XSL documents in one HTML page
prepareStatement returns 0?
Design pattern to compare object based on inherited properties
prepareStatement returns 0?