public static void main(String[] args) { // String(char a[]) 方法 char a[] = {'g','o','o','d'}; String str = new String(a); System.out.println(str); //String(char a[],int offset,int length) 方法 char b[] = {'s','t','u','d','e','n','t'}; String s = new String(b,2,4); System.out.println(s); }