package cn.edu.bjut.chapter4; public class Circle2 { private double diameter; public Circle2(double radius) { this.diameter = 2 * radius; } public double getRadius() { return (diameter / 2); } public void setRadius(double radius) { this.diameter = radius * 2; } public double area() { return (Math.PI * diameter * diameter / 4); } public double perimeter() { return (Math.PI * diameter); } }