D
doxpix
Unregistered / Unconfirmed
GUEST, unregistred user!
public class Foo{
public static void main (String [] args) {
StringBuffer a = new StringBuffer("A");
StringBuffer b = new StringBuffer("B");
operate(a, b);
System.out.println(a + "," + b);
}
static void operate(StringBuffer x, StringBuffer y){
x.append;
y = x;
System.out.println;
}
}
我运行,结果为
AB
AB,B
我以为应该是
AB
AB,AB
请问如何解释?
public static void main (String [] args) {
StringBuffer a = new StringBuffer("A");
StringBuffer b = new StringBuffer("B");
operate(a, b);
System.out.println(a + "," + b);
}
static void operate(StringBuffer x, StringBuffer y){
x.append;
y = x;
System.out.println;
}
}
我运行,结果为
AB
AB,B
我以为应该是
AB
AB,AB
请问如何解释?