创建字符串: 1. String(char a[]) char a[] = {'g','o','o','d'}; String str = new String(a); 2. String(char a[],int offset,int length) char a[] = {'s','t','u','d','e','n','t'}; String str = new String(a,2,4); 3. 通过字符串常量的引用赋值给一个字符串变量: String str1,str2; str1 =…