1.  >>  国开 / 面向对象程序设计
 国开 / 面向对象程序设计

public class XXK2 {

private int a; public XXK2(int aa) {a=aa;}

public int f1(int x) {

if(x%2==1) return 2*(a+x);

else return 3*a+x;

}

public int get() {return a;}

public static void main(String[] args) {

XXK2 x=new XXK2(5);

int y=x.f1(9);

y+=x.get()*x.get();

System.out.println("y="+y);

}

}
y =53
y =62
 参考答案:
 佳题速递: