public class Test
{
static void operate(StringBuffer x, StringBuffer y)
{
x.append(y);
y=x;
}
public static void main(String args[])
{
StringBuffer x=new StringBuffer("Sun");
StringBuffer y=new StringBuffer("Java");
operate(x,y);
System.out.println(x+","+y);
}
}
他的版画:SunJava,Java
谁能解释一下为什么它会这样打印而不是 SunJava,SunJava ?