Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to use copyValueOf() function?  RSS feed

 
lixing1998
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am seeking a code example for using copyValueOf() which is inside String class? Any hints or code is appreciated!
 
Lewin Chan
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

char[] chars = "ABCDEFG".toCharArray();
String s = String.copyValueOf(chars);
// And you might expect s to be "ABCDEFG"
// all in all pretty much the same as
s = new String(chars);
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!