Monday 16 June 2014

copyValueOf (char[] data)

public static String copyValueOf(char[] data)
Returns the string representation of the char array argument. The contents of the character array are copied, subsequent modification of the character array does not affect the returned string.

class StringCopyValueOf{
 public static void main(String args[]){
  char a[] = {'w', 'x', 'y', 'z'};
  String str = String.copyValueOf(a);
  
  System.out.println("str = " + str);
 }
}

Output
str = wxyz




Prevoius                                                 Next                                                 Home

No comments:

Post a Comment