????????????
???????????? ???????[ 2015/3/31 11:50:54 ] ????????Java ??????? ???
????3.????Aggregation??
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????“????-????”?????????
??????????????
????public class People{
????Car car;
????House house;
????//???????????????????????????set???????
????public void setCar(Car car){
????This.car=car;
????}
????public void setHouse(House house){
????This.house=house;
????}
????public void driver(){
????System.out.println(“????????”+car.getType());
????}
????public void sleep(){
????System.out.println(“??????????????”+house.getAddress());
????}
????}
????4.????Composition??
???????????????????????????????????????????????????“????-????”??????????“????”????“????”??????????????????????????????????“????”?????????????κ????塣????????????У?People??Soul??Body?????????????????????????????????????????????壻?????????????????????????????????????????????????壬?????????????????????????????????????
????Public class People{
????Soul soul;
????Body body;
????//??????е???????????????????и??
????Public People(Soul soul??Body body){
????This.soul=soul;
????This.body=body;
????}
????Public void study(){
????System.out.println(“????????”+soul.getName());
????}
????Public void eat(){
????System.out.println(“????????壺”+body.getName());
????}
????}
????5.??У?Generalization??
??????б????????????????????????????????java?У??ù????extends?????й????UML????У???й???????+???????????????????
????6.????Implementation??
?????????????????????????????????????ò?????????????????????????????????java?????implements?????UML????У????????????+????????????????????
??????java?м?????extends????????????implements????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11