《上海国响信息技术有限公司.doc》由会员分享,可在线阅读,更多相关《上海国响信息技术有限公司.doc(8页珍藏版)》请在金锄头文库上搜索。
1、选择题 1: 1. Whatistheresultwhenyoucompileandrunthefollowingcode? 2. 3. publicclassTest 4. 5. 6. 7. publicvoidmethod() 8. 9. 10. 11. for(inti=0;i3;i+) 12. 13. 14. 15. System.out.print(i); 16. 17. 18. 19. System.out.print(i); 20. 21. 22. 23. 24. 25. Choices:What is the result when you compile and run th
2、e following code? public class Test public void method()for(int i = 0; i ” and “”. Which statement is true? A.1010 0000 0000 0000 0000 0000 0000 0000 4 give 0000 1010 0000 0000 0000 0000 0000 0000 B.1010 0000 0000 0000 0000 0000 0000 0000 4 give 1111 1010 0000 0000 0000 0000 0000 0000 C.1010 0000 00
3、00 0000 0000 0000 0000 0000 4 give 0000 0000 0000 0000 0000 0000 0000 0000 D.1010 0000 0000 0000 0000 0000 0000 0000 4 give 1111 1010 0000 0000 0000 0000 0000 0000 9:A class design requires that a member variable should be accessible only by same package, which modifer word should be used? A.protect
4、ed B.public C.no modifer D.private 10: 1. publicclassOuterClass 2. privatedoubled1=1.0; 3. /insertcodehere 4. 5. Youneedtoinsertaninnerclassdeclarationatline3.Whichtwoinnerclassdeclarationsare 6. valid?public class OuterClass private double d1 = 1.0;/insert code hereYou need to insert an inner class
5、 declaration at line 3. Which two inner class declarations arevalid?A.class InnerOne public static double methoda() return d1; B.public class InnerOne static double methoda() return d1; C.private class InnerOne double methoda() return d1; D.static class InnerOne protected double methoda() return d1; 11: 1. publicclassX 2. 3. publicObjectm() 4. 5. Objecto=newFloat(3.14F);/line3 6. 7. Objectoa=newObject1;/line4 8. 9. oa0=o;/line5 10. 11. o=null;/line6 12. 13. returnoa0;/line7 14. 15. 16. 17.