只是很困惑为什么会这样:
public class OneClass {
public static void main(String[] args) {
StringBuilder sb = new StringBuilder("1111");
AnotherClass.updateParameter(sb);
System.out.print(sb);
}
}
public class AnotherClass {
public static void updateParameter(StringBuilder args) {
args.append("2222");
}
}
Output: 1111
谁能解释一下,非常感谢!