您的位置:首页 > 其它

对象的引用

2015-08-11 20:15 239 查看
今天学的知识点不多,但理解起来比较困难,如对象的引用、对象的传参。下面举个例:

public class Chuancan_2 {

public static void main(String[] args) {

int x=1;

Oo_1 m=new Oo_1();

m.age=3;

m=test(m,x);

System.out.print(m.age+" "+x);

}

public static Oo_1 test(Oo_1 m,int x){

m.age=5;

x=2;

m=new Oo_1();

m.age=20;

return m;

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: