Java
public static void method2(String str) {
str += "world";
}
编译后是
public static void method2(String str) {
StringBuilder sb = new StringBuilder();
sb.append(str);
sb.append("world");
str = sb.toString();
}
Java
public static void method2(String str) {
str += "world";
}
编译后是
public static void method2(String str) {
StringBuilder sb = new StringBuilder();
sb.append(str);
sb.append("world");
str = sb.toString();
}