File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
EJB 3 in Action
this week in the
EJB and other Java EE Technologies
String.valueOf() and String.copyValueOf()
Joined: May 28, 2003
Sep 16, 2003 22:13:00
Dear all ranchers,
What's the difference between String.valueOf(char data) and String.copyValueOf(char data)?
Never do things the hard way if you don't have a good reason.
Joined: Jun 25, 2003
Sep 16, 2003 22:55:00
I think there is no difference between the two methods. As both the methods return a
representation of Character array which is being passed as a parameter.
Prasanna Kumar R.V
Joined: Dec 10, 2001
Sep 18, 2003 03:04:00
the Class Documentation
isn't clear about such details, then you could always take a look at the source code, which should be available in a file named src.jar or src.zip in your Java 2 SDK installation.
How To Ask Good Questions
JavaRanch FAQ Wiki
Joined: Sep 18, 2003
Sep 18, 2003 03:28:00
Looking at the source code for Java 1.4.2, both methods are exactly the same in terms of implementation.
<a href="http://www.netspade.com/" target="_blank" rel="nofollow">http://www.netspade.com/</a> - Web programming articles and tutorials.
I agree. Here's the link:
subject: String.valueOf() and String.copyValueOf()
toString() and null
Difference between String.copyValueOf(char) and String.valueOf(char)
copyValueOf vs ValueOf
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014