本帖最后由 杨雯雯 于 2013-1-1 15:11 编辑
public class Test2 {
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);
y = x;
}
}
我对值传递和引用传递还是有些模糊,请大虾帮忙讲一下这段代码值传递和引用传递的体现 |