Tuesday, 24 June 2014

valueOf (char[] data)

public static String valueOf(char[] data)
Returns the string representation of the char array argument.

class StringValueOfCharArray{
 public static void main(String args[]){
  char arr[] = {'d', 'e', 'f'};
  
  String str1 = String.valueOf(arr);
  
  System.out.println("str1 = " + str1);
 }
}

Output
str1 = def





Prevoius                                                 Next                                                 Home

No comments:

Post a Comment