目录

static String copyValueOf(char[] data)

描述 (Description)

此方法返回一个String,表示指定数组中的字符序列。

语法 (Syntax)

以下是此方法的语法 -

public static String copyValueOf(char[] data)

参数 (Parameters)

这是参数的细节 -

  • data - 字符数组。

回报价值

  • 此方法返回包含字符数组字符的String。

例子 (Example)

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);
   }
}

这将产生以下结果 -

输出 (Output)

Returned String: hello world
↑回到顶部↑
WIKI教程 @2018