test

// 円クラス
abstract class Shape{
    abstract void Display();
}

// 円クラス
class Circle extends Shape implements Area{
    int x;
    int y;
    int r;


    Circle(int x, int y, int r ){
        this.x = x;
        this.y = y;
        this.r = r;
    }

    void Display(){
        System.out.println("x=" + x + ", y=" + y + ", r=" + r);
    }


    // 面積を計算する
    public double getArea(){
        return r*r*Math.PI;    // Math.PI:円周率
    }
}

// 長方形クラス
class Rect extends Shape implements Area{
    int x1;
    int y1;
    int x2;
    int y2;


    Rect(int x1, int y1, int x2, int y2 ){
        this.x1 = x1;
        this.y1 = y1;
        this.x2 = x2;
        this.y2 = y2;
    }

    void Display(){
        System.out.println("x1=" + x1 + ", y1=" + y1 + ", x2=" + y2 + ", y2=" + y2);
    }


    // 面積を計算する
    public double getArea(){
        // Math.abs : 絶対値を求めるメソッド
        return Math.abs(x1-x2) * Math.abs(y1-y2);
    }
}