英语不好,就拿拼音吧.
public class Juxing {
private double a;
private double b;
// 计算周长
public double zhouchang() {
return 2 * (a + b);
}
// 计算面积
public double mianji() {
return a * b;
}
public double getA() {
return a;
}
public void setA(double a) {
this.a = a;
}
public double getB() {
return b;
}
public void setB(double b) {
this.b = b;
}
}