高内聚 低耦合
继承 > 关联 > 依赖
package test1;
public class SanJiaoXing extends TuXing {
public SanJiaoXing(String point) {
super(point);
}
public void draw() {
}
}
package test1;
public class JuXing extends TuXing {
public JuXing(String point){
super(point);
}
public void draw() {
System.out.println("ju xing");
}
}
package test1;
public class SanJiaoXing extends TuXing {
public SanJiaoXing(String point) {
super(point);
}
public void draw() {
}
}