题目内容
public class UseRef{public static void main(String[] args){MyClass1 myobj,myref;myobj=new MyClass(-1);myref=myobj;System.out.println("the original date is"+myobj.getData());myref.setData(10);System.out.println("now the data is:"+myobj.getData());}}class MyClass1{int data;MyClass1(int d){data=d;}int getData(){return data;}void setData(int d){data=d;}}
查看答案
搜索结果不匹配?点我反馈