熟悉eclipse的使用 课本P73 T9
class Src {
public int aN
=3;
public Src(int aa
){
if (aa
>=0){
aN
=aa
;}
}
}
class Dis{
Src s
;
public Dis(Src ss
){
this.s
=ss
;
}
public void changeSrc(int b
){
if (b
<0){
System
.out
.println("不为非负");
}
else if (b
==s
.aN
){
}
else{
s
.aN
=b
;
System
.out
.println(s
.aN
);
}
}
}
public class RunD_C{
public static void main(String args
[]){
Src src
=new Src(6);
Dis dis
=new Dis(src
);
dis
.changeSrc(5);
}
}
仅根据题目完成部分要求,其中特定方法changeScr可能不是很符合题意
C++好像是大一学的,课时比计科少,好多都不懂,没学过C,但是高性能用过,后面都用R和python了
刚刚看完第五章,作业在写了。第六章看到接口,还没太弄明白。