资源预览内容
第1页 / 共10页
第2页 / 共10页
第3页 / 共10页
第4页 / 共10页
第5页 / 共10页
第6页 / 共10页
第7页 / 共10页
第8页 / 共10页
第9页 / 共10页
第10页 / 共10页
亲,该文档总共10页全部预览完了,如果喜欢就下载吧!
资源描述
北京宇信易诚科技有限公司招聘JAVA笔试真题及答案选择题 1:鉴于Java的特点,它最适合的计算环境是bA.并行计算环境 B.分布式计算环境 C.高强度计算环境 D.开放式计算环境 2:Which method you define as the starting point of new thread in a class from which new the thread can be excution? bA.public void start() B.public void run() C.public void runnable() D.public static void main(String args) 3:Which statement about listener is true? A 什么是ListenerA.Most component allow multiple listeners to be added. B.If multiple listener be add to a single component, the event only affected one listener. C.Component don?t allow multiple listeners to be add. D.none 4:软件生命周期的瀑布模型把软件项目分为3个阶段、8个子阶段,以下哪一个是正常的开发顺序? aA.计划阶段、开发阶段、运行阶段 B.设计阶段、开发阶段、编码阶段 C.设计阶段、编码阶段、维护阶段 D.计划阶段、编码阶段、测试阶段 5: b 1. Whatwillbeprintedwhenyouexecutethefollowingcode? 2. 3. classX 4. 5. Yb=newY(); 6. X() 7. 8. System.out.print(X); 9. 10. 11. 12. classY 13. 14. Y() 15. 16. System.out.print(Y); 17. 18. 19. 20. publicclassZextendsX 21. 22. Yy=newY(); 23. Z() 24. 25. System.out.print(Z); 26. 27. publicstaticvoidmain(Stringargs) 28. 29. newZ(); 30. 31. 32. 33. Choices:What will be printed when you execute the following code? class X Y b = new Y(); X() System.out.print(X); class Y Y() System.out.print(Y); public class Z extends X Y y = new Y(); Z() System.out.print(Z); public static void main(String args) new Z(); Choices:A.Z B.YZ C.XYZ D.YXYZ 6: c1. Givethefollowingmethod: 2. publicvoidmethod() 3. Stringa,b; 4. a=newString(“helloworld”); 5. b=newString(“gameover”); 6. System.out.println(a+b+”ok”); 7. a=null; 8. a=b; 9. System.out.println(a); 10. 11. Intheabsenceofcompileroptimization,whichistheearliestpointtheobjectareferedisdefinitelyelibiletobegarbagecollection.Give the following method: public void method( ) String a,b; a=new String(“hello world”); b=new String(“game over”); System.out.println(a+b+”ok”); a=null; a=b; System.out.println(a); In the absence of compiler optimization, which is the earliest point the object a refered is definitely elibile to be garbage collection.A.before line 5 B.before line 6 C.before line 7 D.before line 9 7: c1. Whichisthemostappropriatecodesnippetthatcanbeinsertedatline18inthefollowingcode? 2. 3. (Assumethatthecodeiscompiledandrunwithassertionsenabled) 4. 5. 1.importjava.util.*; 6. 7. 2. 8. 9. 3.publicclassAssertTest 10. 11. 4. 12. 13. 5.privateHashMapcctld; 14. 15. 6. 16. 17. 7.publicAssertTest() 18. 19. 8. 20. 21. 9.cctld=newHashMap(); 22. 23. 10.cctld.put(in,India); 24. 25. 11.cctld.put(uk,UnitedKingdom); 26. 27. 12.cctld.put(au,Australia); 28. 29. 13./morecode. 30. 31. 14. 32. 33. 15./othermethods. 34. 35. 16.publicStringgetCountry(StringcountryCode) 36. 37. 17. 38. 39. 18./Whatshouldbeinsertedhere? 40. 41. 19.Stringcountry=(String)cctld.get(countryCode); 42. 43. 20.returncountry; 44. 45. 21. 46. 47. 22.Which is the most appropriate code snippet that can be inserted at line 18 in the following code?(Assume that the code is compiled and run with assertions enabled)1. import java.util.*;2. 3. public class AssertTest4. 5. private HashMap cctld;6. 7. public AssertTest()8. 9. cctld = new HashMap();10. cctld.put(in, India);11. cctld.put(uk, United Kingdom);12. cctld.put(au, Australia);13. / more code. 14. 15. / other methods . 16. public String getCountry(String countryCode)17. 18. / What should be inserted here?19. String country = (String)cctld.get(countryCode);20. return country;21. 22. A.assert countryCode != null; B.assert countryCode != null : Country code can not be null ; C.assert cctld != null : No country code data is available; D.assert cctld : No country code data is available; 8:Which declares for native method in a java class corrected? bA.public native void method() B.public native void method(); C.public native method(); D.public void native method()
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号