当前位置:SCJP程序员认证考试题库

问题:

[单选]

11. class Payload { 
12. private int weight; 
13. public Payload(int wt) { weight = wt; } 
13. public void setWeight(mt w) { weight = w; } 
15. public String toString { return Integer.toString(weight); } 
16. } 
17. 
18. public class TestPayload { 
19. static void changePayload(Payload p) {
20. /* insert code here */
21. } 
22. 
23. public static void main(String[] args) { 
24. Payload p = new Payload(); 
25. p.setWeight(1024); 
26. changePayload(p); 
27. System.out.println(”The value of p is “+ p); 
28. } 
29. } 
Which statement, placed at line 20, causes the code to print “The value of p is 420.”?() 

A .  p.setWeight(420);
B .  p.changePayload(420);
C .  p = new Payload(420);
D .  Payload.setWeight(420);
E .  p = Payload.setWeight(420);
F .  p = new Payload(); p.setWeight(420);

房地产作为不动产,最大的优点是流动性较好。 土壤容重 设计投资组合时,必须遵循的原则:在风险一定的条件下,保证组合收益的最大化;在收益一定的条件下,保证组合风险的最小化。 如果租售比低于1:300,意味着房产投资价值相对变小。 在标准大气状态下,瓦斯爆炸的瓦斯浓度范围为()。 1.5%~10%。 5%~16%。 3%~10%。 10%~16%。

11. class Payload { 
12. private int weight; 
13. public Payload(int wt) { weight = wt; } 
13. public void setWeight(mt w) { weight = w; } 
15. public String toString { return Integer.toString(weight); } 
16. } 
17. 
18. public class TestPayload { 
19. static void changePayload(Payload p) {
20. /* insert code here */
21. } 
22. 
23. public static void main(String[] args) { 
24. Payload p = new Payload(); 
25. p.setWeight(1024); 
26. changePayload(p); 
27. System.out.println(”The value of p is “+ p); 
28. } 
29. } 
Which statement, placed at line 20, causes the code to print “The value of p is 420.”?() 

参考答案:

  参考解析

本题暂无解析

在线 客服