package com.lovecding.day07.oop05;

public class Circle {
    public double r;
    /**
     * @return 面积
     */
    public double area(){
        return Math.PI*r*r; //返回值具体数据 是double类
    }
    /**
     * @return 周长
     */
    public double perimeter(){
        return 2*Math.PI*r;
    }
    public String getInfo(){
        return "半径"+r+",周长"+perimeter()+"面积"+area();
    }
    //提示
    public void setR( double r1 ){
        r = r1;
        // 年月日 三次赋值
    }
    public static void main(String[] args) {
        Circle c1 = new Circle();
        c1.r = 10;
        System.out.println(c1.getInfo());
        Circle c2 = new Circle();
        c2.r = 20;
        double area = c2.area();
        System.out.println("c2 面积是"+area);

        System.out.println(c2.getInfo());

    }
}
