Java String copyValueOf() 方法 描述 该方法返回一个表示指定数组中字符序列的字符串。 语法 以下是该方法的语法 – public static String copyValueOf(char[] data)JavaCopy 参数 以下是参数的详细信息: data - 字符数组。 返回值 该方法返回一个包含字符数组中字符的字符串。 示例 public class Test { public static void main(String args[]) { char[] Str1 = {'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'}; String Str2 = ""; Str2 = Str2.copyValueOf( Str1 ); System.out.println("Returned String: " + Str2); } }JavaCopy 这将产生以下结果 – 输出 Returned String: hello worldJavaCopy