标题:谁知道答案是多少?为什么?
取消只看楼主
gao789li123
Rank: 2
等 级:论坛游民
帖 子:6
专家分:25
注 册:2014-6-25
结帖率:100%
已结贴  问题点数:20 回复次数:1 
谁知道答案是多少?为什么?
谁知道答案是多少?为什么?
package de;

public class TestStudent {
   
     public static void main(String args[]) {
             TestStudent ts = new TestStudent();
            Student student = new Student();  
            student.setId(1);  
            student.setName("elong");  
            student.setClassId(1);  
            
            ts.change(student);  
            System.out.println(student);  
        }  
        public void change(Student student){  
            Student student2 = new Student();  
            student2.setId(2);  
            student2.setName("elongdeo");  
            student2.setClassId(2);  
         
            student.setId(3);  
            student.setName("dingyinlong");  
            student.setClassId(3);  
           
            student = student2;   
        
            student.setId(4);  
            student.setName("yinlong");  
            student.setClassId(4);  
        }  

}
搜索更多相关主题的帖子: package public change elong 
2014-06-28 16:06
gao789li123
Rank: 2
等 级:论坛游民
帖 子:6
专家分:25
注 册:2014-6-25
得分:0 
答案显示输出的是
2014-06-28 16:07



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-433446-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.684396 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved