java的面向抽象原则
- 未使用抽象原则
圆面积的计算
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
圆柱体体积计算
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
public class Recatangle {
double a,b;
Recatangle(double a,double b){
this.a = a;
this.b = b;
}
public double getArea(){
return a*b;
}
}
宁波艺星整形
http://www.lyxcl.org/