package cn.edu.bjut.chapter3; public class Circle { private double r; public static final double PI = 3.14; public Circle(double r) { this.r = r; } public double area() { return (r * r * PI); } public static void main(String[] args) { Circle c1 = new Circle(2); Circle c2 = new Circle(3); System.out.println(c1.area() + "\t" + c2.area()); } }