public class FOO {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
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);
y = x;
y.append("A");
}
}
为什么输出结果是ABA,B
求教...
|