This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package jichuti;
/**
* 正方形类(实现Shape接口)
*/
* 圆形类(辅助测试,实现Shape接口)
public class Circle implements Shape, tiaozhanti.Shape {
private String color; // 颜色
private double radius; // 半径
public Circle(String color, double radius) {
this.color = color;
this.radius = radius;
}
@Override
public String getColor() {
return color;
public double getArea() {
return Math.PI * radius * radius; // 圆形面积=πr²
public double getRadius() { return radius; }