动力节点入学测试(中文).doc

上传人:文库蛋蛋多 文档编号:3428195 上传时间:2023-03-13 格式:DOC 页数:10 大小:31KB
返回 下载 相关 举报
动力节点入学测试(中文).doc_第1页
第1页 / 共10页
动力节点入学测试(中文).doc_第2页
第2页 / 共10页
动力节点入学测试(中文).doc_第3页
第3页 / 共10页
动力节点入学测试(中文).doc_第4页
第4页 / 共10页
动力节点入学测试(中文).doc_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《动力节点入学测试(中文).doc》由会员分享,可在线阅读,更多相关《动力节点入学测试(中文).doc(10页珍藏版)》请在三一办公上搜索。

1、姓名:_孙海阔_ QQ:_369019497_注意:如果没有特殊说明那么为单选Question 1Given:35. String #name = Jane Doe;36. int $age=24;37. Double _height = 123.5;38. double temp = 37.5;下面有两个答案是正确的?A. 35行不能编译通过B. 36行不能编译通过C. 37行不能编译通过D. 38行不能编译通过Answer: AD Question 2Given:11. public class Test 12. public static void main(String args) 1

2、3. int x =5;14. boolean b1 = true;15. boolean b2 = false;16.17.if(x=4) & !b2)18. System.out.print(l );19. System.out.print(2 );20. if (b2 = true) & b1)21. System.out.print(3);22. 23. 输出结果?A. 2B. 3C. 1 2D. 2 3E. 1 2 3F. 编译错误G. 抛出运行期异常Answer: D Question 3Given:11. public static void main(String args)

3、12. for (int i=0;i6) break;14. 15. System.out.println(i);16. 输出结果?A. 6B. 7C. 10D. 11E. 编译错误.F. 抛出运行时异常.Answer: E Question 4Given:13. public class Pass 14. public static void main(String args) 15. int x 5;16. Pass p = new Pass();17. p.doStuff(x);18. System.out.print(main x = + x);19. 20.21. void doSt

4、uff(int x) 22. System.out.print( doStuffx =+ x+);23. 24. 输出结果?A. 编译错误.B. 发生运行期异常.C. doStuffx = 6 main x = 6D. doStuffx = 5 main x = 5E. doStuffx = 5 main x = 6F. doStuffx = 6 main x = 5Answer: D Question 5Given:11. public static void main(String args) 12. Object obj =new int 1,2,3 ;13. int someArray

5、 = (int)obj;14. for (int i: someArray) System.out.print(i + )15. 输出结果?A. 1 2 3B. 在12行发生编译错误.C. 在13行发生编译错误.D. 在14行发生编译错误.E. 抛出ClassCastException异常.Answer: A Question 6Given:11. public interface Status 12. /* 请再这里加入代码 */ int MY_VALUE = 10;13. 在第12行加入的代码,下面有3个是正确的?A. finalB. staticC. nativeD. publicE.

6、privateF. abstractG. protectedAnswer: ABD Question 7Given:1. public class A 2. public void doit() 3. 4. public String doit() 5. return a;6. 7. public double doit(int x) 8. return 1.0;9. 10.输出结果?A. 发生异常.B. 第7行编译错误.C. 第4行编译错误.D. 编译成功.Answer: D Question 8Given:10. interface A void x(); 11. class B impl

7、ements A public void x() public void y() 12. class C extends B public void x() And:20. java.util.List list = new java.util.ArrayList();21. list.add(new B();22. list.add(new C();23. for (A a:list) 24. a.x();25. a.y();26. 输出结果?A. 该代码没有输出结果.B. 抛出异常.C. 第20行编译错误.D. 第21行编译错误.E. 第23行编译错误.F. 第25行编译错误.Answer

8、: E Question 9Given:1. class SuperClass 2. public A getA() 3. return new A();4. 5. 6. class SubClass extends SuperClass 7. public B getA() 8. return new B();9. 10. 下面哪种情况是正确的?A. 如果A继承B编译正确.B. 如果B继承A编译正确.C. 第7行编译错误.D. 第8行编译错误.Answer: C Question 10Given:11. class ClassA 12. class ClassB extends ClassA

9、 13. class ClassC extends ClassA and:21. ClassA p0 = new ClassA();22. ClassB p1 = new ClassB();23. ClassC p2 = new ClassC();24. ClassA p3 = new ClassB();25. ClassA p4 = new ClassC();下面答案有三个是正确的?A. p0 = p1;B. p1 =p2;C. p2 = p4;D. p2 = (ClassC)p1;E. p1 = (ClassB)p3;F. p2 = (ClassC)p4;Answer: CDF Quest

10、ion 11Given:10. abstract class A 11. abstract void al();12. void a2() 13. 14. class B extends A 15. void a1() 16. void a2() 17. 18. class C extends B void c1() and:A x = new B(); C y = new C(); A z = new C();下面答案中哪四个为多态调用?A. x.a2();B. z.a2();C. z.c1();D. z.a1();E. y.c1();F. x.a1();Answer: BDF Questi

11、on 12Given:10. public class Hello 11. String title;12. int value;13. public Hello() 14. title += World;15. 16. public Hello(int value) 17. this.value = value;18. title = Hello;19. Hello();20. 21. and:30. Hello c = new Hello(5);31. System.out.println(c.title);输出结果?A. HelloB. Hello WorldC. 编译错误.D. Hel

12、lo World 5E. 没有输出结果.F. 抛出异常.Answer: B Question 13Given:10. public class Foo 11. static int a;12. static a0=2; 13. public static void main( String args) 14. 运行以上代码将会抛出什么异常?A. java.lang. StackOverflowErrorB. java.lang.IllegalStateExceptionC. java.lang.ExceptionlnlnitializerErrorD. java.lang.Arraylndex

13、OutOfBoundsExceptionAnswer: C Question 14Given:1. import java.util.*;2. public class Example 3. public static void main(String args) 4. / 加入代码5. set.add(new integer(2);6. set.add(new integer(l);7. System.out.println(set);8. 9. 将哪个代码加入到第4行,输出为1, 2?A. Set set = new TreeSet();B. Set set = new HashSet()

14、;C. Set set = new SortedSet();D. List set = new SortedList();E. Set set = new LinkedHashSet();Answer: E Question 15Given:11. public class Person 12. private String name, comment;13. private int age;14. public Person(String n, int a, String c) 15. name = n; age = a; comment = c;16. 17. public boolean

15、 equals(Object o) 18. if(! (o instanceof Person) return false;19, Person p = (Person)o;20. return age = p.age & name.equals(p.name);21. 22. 在Person类中如何定义hashCode()方法是正确的?A. return super.hashCode();B. return name.hashCode() + age * 7;C. return name.hashCode() + comment.hashCode() /2;D. return name.ha

16、shCode() + comment.hashCode() / 2 - age * 3;Answer: D Question 16Given:1. public class Threads3 implements Runnable 2. public void run() 3. System.out.print(running);4. 5. public static void main(String args) 6. Thread t = new Thread(new Threads3();7. t.run();8. t.run();9. t.start();10. 11. 输出结果?A.

17、编译错误B. 抛出异常.C. 输出 running.D. 输出 runningrunning.E. 输出 runningrunningrunning.Answer: E Question 17Given:1. public class Threads4 2. public static void main (String args) 3. new Threads4().go();4. 5. public void go() 6. Runnable r = new Runnable() 7. public void run() 8. System.out.print(foo);9. 10. ;1

18、1. Thread t = new Thread(r);12. t.start();13. t.start();14. 15. 输出结果?A. 编译错误.B. 抛出异常.C. 执行正常,输出 foo.D. 执行正常,没有输出.Answer: B Question 18选出3个编译正确的?A. private synchronized Object o;B. void go() synchronized() /* code here */ C. public synchronized void go() /* code here */ D. private synchronized(this) void go() /* code here */ E. void go() synchronized(Object.class) /* code here */ F. void go() Object o = new Object();synchronized(o) /* code here */ Answer: CEF

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 教育教学 > 成人教育


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号