You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
314 B
14 lines
314 B
// 文件名:Circle.java
|
|
public class Circle extends Shape {
|
|
private double radius; // 半径
|
|
|
|
public Circle(double radius) {
|
|
this.radius = radius;
|
|
}
|
|
|
|
// 实现父类的抽象方法
|
|
@Override
|
|
public double getArea() {
|
|
return Math.PI * radius * radius;
|
|
}
|
|
}
|