1700468728
1700468729
this.position=_position;
1700468730
1700468731
this.salary=_salary;
1700468732
1700468733
}
1700468734
1700468735
//获得员工信息
1700468736
1700468737
public String getInfo(){
1700468738
1700468739
String info=””;
1700468740
1700468741
info=“姓名:”+this.name;
1700468742
1700468743
info=info+”\t职位:”+this.position;
1700468744
1700468745
info=info+”\t薪水:”+this.salary;
1700468746
1700468747
return info;
1700468748
1700468749
}
1700468750
1700468751
//设置父节点
1700468752
1700468753
protected void setParent(Corp_parent){
1700468754
1700468755
this.parent=_parent;
1700468756
1700468757
}
1700468758
1700468759
//得到父节点
1700468760
1700468761
public Corp getParent(){
1700468762
1700468763
return this.parent;
1700468764
1700468765
}
1700468766
1700468767
}
1700468768
1700468769
就增加了粗体部分,然后我们再来看看树枝节点的改变,如代码清单21-26所示。
1700468770
1700468771
代码清单21-26 树枝构件
1700468772
1700468773
public class Branch extends Corp{
1700468774
1700468775
//领导下边有那些下级领导和小兵
1700468776
1700468777
ArrayList<Corp>subordinateList=new ArrayList<Corp>();
[
上一页 ]
[ :1.700468728e+09 ]
[
下一页 ]