23,407
社区成员
发帖
与我相关
我的任务
分享
public class StringArrayChange {
public static void main(String[] args) {
String a = "world";
char c[] = a.toCharArray();
for (int i = 0; i < c.length; i++)
System.out.print(c[i]);
System.out.println();
String b = new String(c);
String d = new String(c, 0, 3);
System.out.println(b);
System.out.println(d);
}
}