益模软件Java笔试题
java笔试题目
QUESTION NO: 1
1. public class Test {
2. public static void main(String args[]) {
3. class Foo {
4. public int i = 3;
5. }
6. Object o = (Object)new Foo();
7. Foo foo = (Foo)o;
8. System.out.println(“i = “ + foo.i);
9. }
10. }
What is the result?
A. i = 3
B. Compilation fails.
C. A ClassCastException is thrown at line 6.
D. A ClassCastException is thrown at line 7.
QUESTION NO: 2
11. int i =1,j =10;
12. do {
13. if(i++> –j) {
14. continue;
15. }
16. } while (i j) {
14. break;
15. }
16. j–;
17. } while (++i
QUESTION NO: 1
1. public class Test {
2. public static void main(String args[]) {
3. class Foo {
4. public int i = 3;
5. }
6. Object o = (Object)new Foo();
7. Foo foo = (Foo)o;
8. System.out.println(“i = “ + foo.i);
9. }
10. }
What is the result?
A. i = 3
B. Compilation fails.
C. A ClassCastException is thrown at line 6.
D. A ClassCastException is thrown at line 7.
QUESTION NO: 2
11. int i =1,j =10;
12. do {
13. if(i++> –j) {
14. continue;
15. }
16. } while (i j) {
14. break;
15. }
16. j–;
17. } while (++i
【益模软件Java笔试题】相关文章
1. 益模软件Java笔试题
2. 群胜软件Java笔试题
4. 什么是典型的软件三层结构?软件设计为什么要分层?软件分层有什么好处?
7. 创联软件面试题笔试题
本文来源:https://www.mianshiwenti.com/a12215.html
进入下载页面
上一篇:类、抽象类、接口的差异
下一篇:介绍java中初始化块的使用