/**
 * Shape接口
 * @author chen
 *
 */
public interface Shape {
    public abstract double area(double d);
    
}
/**
 * Square类实现Shape接口
 * @author chen
 *
 */
public class Square implements Shape{
    @Override
    public double area(double width) {
        // TODO Auto-generated method stub
        return width*width;
    }  
}
/**
 * Circle类实现Shape接口
 * @author chen
 *
 */
public class Circle implements Shape{
    @Override
    public double area(double radius) {
        // TODO Auto-generated method stub
        return Math.PI*radius*radius;
    }
}

/**
 * 测试类
 * @author chen
 *
 */
public class Test {
    @org.junit.Test
    public void test(){
        Square square = new Square();
        System.out.println("正方形边长为2的面积是:"+square.area(2));
        Circle circle = new Circle();
        System.out.println("半径为3的圆的面积是:"+circle.area(3));
    }

}