public class rectangle {
double chang;
double kuan;
void rectangle() {
double mianji;
mianji = chang * kuan;
System.out.println(mianji);
}
void rectangl() {
{
double zhouchang;
zhouchang = (chang = kuan) * 2;
System.out.println(zhouchang);
}
}
public static void main(String[] args) {
rectangle r = new rectangle();
r.chang = 3;
r.kuan = 4;
r.rectangle();
r.rectangl();
}
}
----------------解决方案--------------------------------------------------------
double chang;
double kuan;
void rectangle() {
double mianji;
mianji = chang * kuan;
System.out.println(mianji);
}
void rectangl() {
{
double zhouchang;
zhouchang = (chang = kuan) * 2;
System.out.println(zhouchang);
}
}
public static void main(String[] args) {
rectangle r = new rectangle();
r.chang = 3;
r.kuan = 4;
r.rectangle();
r.rectangl();
}
}
----------------解决方案--------------------------------------------------------