SCJP考试题310-025(第二套)19-50/147

来源:java认证发布时间:2012-11-12 13:05:39java认证视频


Question No 47
Exhibit:
1. public class test (
2. public static void main(string args[]) {
3. int 1= 0;
4. while (i) {
5. if (i==4) {
6. break;
7. )
8. ++i;
9. )
10.
11. )
12. )
What is the value of i at line 10?
A. 0
B. 3
C. 4
D. 5
E. The code will not compile.
Answer: E
Question No 48
Given:
3. int i= 1, j= 10 ;
4. do (
5. if (i++> --j) continue;
6. ) while (i<5);
After execution, what are the values for I and j?
A. i = 6 and j= 5
B. i = 5 and j= 5
C. i = 6 and j= 4
D. i = 5 and j= 6
E. i = 6 and j= 6
Answer: D
Question No 49
Given:
1. switch (i) {
2. default:
310-025
Leading the way in IT testing and certification tools, www.testking.com
- 27 -
3. System.out.printIn(“Hello”);
4. )
What are the two acceptable types for the variable i? (Choose Two)
A. Char
B. Byte
C. Float
D. Double
E. Object
Answer: A, B
Question No 50
Given:
1. public class foo {
2. public static void main (string[]args)
3. try {return;}
4. finally {system.out.printIn(“Finally”);}
5. }
6. )
What is the result?
A. The program runs and prints nothing.
B. The program runs and prints “Finally”
C. The code compiles, but an exception is thrown at runtime.
D. The code will not compile because the catch block is missing.
Answer: B

上一页234下一页

视频学习

我考网版权与免责声明

① 凡本网注明稿件来源为"原创"的所有文字、图片和音视频稿件,版权均属本网所有。任何媒体、网站或个人转载、链接转贴或以其他方式复制发表时必须注明"稿件来源:我考网",违者本网将依法追究责任;

② 本网部分稿件来源于网络,任何单位或个人认为我考网发布的内容可能涉嫌侵犯其合法权益,应该及时向我考网书面反馈,并提供身份证明、权属证明及详细侵权情况证明,我考网在收到上述法律文件后,将会尽快移除被控侵权内容。

最近更新

社区交流

考试问答