发布网友 发布时间:2024-04-13 00:47
共3个回答
热心网友 时间:2024-11-30 06:49
String str = "hello world";热心网友 时间:2024-11-30 06:50
public void test(){追问我的确这么弄的,为啥报错呢
追答public void test(){
String author[] = {"a","b","c"};
String s = "";
StringBuffer sb = new StringBuffer();
for (int i = 0; i < author.length-1; i++) {
sb.append(author[i]);
}
System.out.println(sb.toString());
}
热心网友 时间:2024-11-30 06:50
用循环 stringBuffer.append