public class Test2 {
public static void main(String[] args) {
StringBuffer a = new StringBuffer("A");
StringBuffer b = new StringBuffer("B");
menthod(a, b);
System.out.println(a + "," + b);
}
static void menthod(StringBuffer x, StringBuffer y) {
x.append(y);
y = x;
}
}
為什麼輸出結果是AB,B啊?