File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference bet valueOf() and toString()

 
parag bharambe
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the major difference between valueOf() and toString() methods
 
Noah Carroll
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The valueOf() method returns a value that is equal to the String passed as an argument. The toString() method returns a String representation of the argument, or of the object itself.
i hope this helps
 
parag bharambe
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Noah
I am getting somewhat but would appreciate if you elabotare it with the example. And some explanation.


[This message has been edited by parag bharambe (edited September 21, 2000).]
 
Stephanie Grasson
Ranch Hand
Posts: 347
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Parag,
As Noah said,
The valueOf() method returns a value that is equal to the String passed as an argument. Using the Integer class as an example...
Here is its declaration:

The toString() method returns a String representation of the argument, or of the object itself.
Here is its declaration:

Here is an example:

Hope this helps.
Stephanie
 
parag bharambe
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Stephanie
Your reply is nice and explanative.
i got the funda clearly
parag
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic