This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes valueOf() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "valueOf() method" Watch "valueOf() method" New topic
Author

valueOf() method

Mohit Agarwal
Ranch Hand

Joined: Mar 30, 2004
Posts: 88
The code snippet :

System.out.println(String.valueOf(1)+String.valueOf(2));
give ans 12.

But valueOf method takes a String as an argument .
How this happens?


Mohit Agarwal
Would Be SCJP.

"The will to win is worthless if you do not have the will to prepare"
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
I suggest that you take another, closer loook at the String API.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: valueOf() method
 
Similar Threads
Difference between valueOf()Method and toString()Method
valueOf
Some string questions
ValueOf()
Have a question about convert int to string