Java 字符串拼接是直接这样:
String b = "123";
String d = "a" + b + "c" + ...;
还是调用像这样的方法,好一些:
public static String append(Object... strings) {
if (strings.length == 0) {
return "";
}
StringBuilder builder = new StringBuilder(Arrays.toString(strings).length);
for (String str : strings) {
builder.append(str);
}
return builder.toString();
}
理由是...