一个基础题
public class wo{
public static void main (String args[]) throws IOException
{
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;
}
}
输出AB B
为什么?