




已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
选择题 1:Which of the following statements are not legal? A.long l = 4990; B.int i = 4L; C.double d = 34.4; D.double t = 0.9F. 2: 1. Whatwillbetheresultofexecutingthefollowingcode? 2. 3. publicstaticvoidmain(Stringargs) 4. 5. chardigit=a; 6. for(inti=0;i10;i+) 7. 8. switch(digit) 9. 10. casex: 11. 12. intj=0; 13. System.out.println(j); 14. 15. default: 16. 17. intj=100; 18. System.out.println(j); 19. 20. 21. 22. inti=j; 23. System.out.println(i); 24. 25. 26. Choices:What will be the result of executing the following code? public static void main(String args) char digit = a; 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 0000 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 12:使用 JDBC 可以做到的是 A.把二进制代码传送到任何关系数据库中 B.把 Java 源代码传送到任何关系数据库中 C.把表单信息传送到任何关系数据库中 D.很容易地把 SQL 语句传送到任何关系数据库中 13: Which of the following statements are true? A.The automatic garbage collection of the JVM prevents programs from ever running out of memory B.A program can suggest that garbage collection be performed and force it C.Garbage collection is platform independent D.An object becomes eligible for garbage collection when all references denoting it are set to null. 14: 1. Whathappenswhenyoutrytocompileandrunthefollowingprogram? 2. classMystery 3. Strings; 4. publicstaticvoidmain(Stringargs) 5. Mysterym=newMystery(); 6. m.go(); 7. 8. voidMystery() 9. s=”constructor”; 10. 11. voidgo() 12. System.out.println(s); 13. 14. What happens when you try to compile and run the following program?class MysteryString s;public static void main(String args)Mystery m=new Mystery();m.go();void Mystery()s=”constructor”;void go()System.out.println(s);A.this code compliles but throws an exception at runtime B.this code runs but nothing appears in the standard output C.this code runs and “constructor” in the standard output D.this code runs and writes ”null” in the standard output 15: 1. 1.publicclassX 2. 2.publicobjectm() 3. 3.objecto=newfloat(3.14F); 4. 4.objectoa=newobject1; 5. 5.oa0=o; 6. 6.o=null; 7. 7.oa0=null; 8. 8.returno; 9. 9. 10. 10. 11. Whenisthefloatobjectcreatedinline3,eligibleforgarbagecollection? 1. public class X 2. public object m () 3. object o = new float (3.14F); 4. object oa = new object 1; 5. oa0= o; 6. o = null; 7. oa0 = null; 8.return o; 9. 10. When is the float object created in line 3, eligible for garbage collection? A.Just after line 5 B.Just after line 6 C.Just after line 7 D.Just after line 8(that is, as the method returns) 16: 1. 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; 简答题 17:jsp有哪些内置对象?作用分别是什么? 18:写出不
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025合同模板设备租赁合同(设备有抵押)范本
- 公司养老护理员安全技术规程
- 2025企业用工劳动合同书
- 2025国际设备采购合同(2)
- 2025梧桐树买卖合同
- 专项法律知识培训合同课件
- 个人之间借款协议书
- 2026届江苏省苏北地区七年级数学第一学期期末复习检测模拟试题含解析
- 2026届北京朝阳区数学九年级第一学期期末联考模拟试题含解析
- 专家下沉相关知识培训课件
- 河堤护坡方案范本
- 2025机械设备购销合同样本模板
- 农机农艺融合培训课件
- 张掖辅警考试题目及答案
- 绩效考核模板:物流企业客户服务、仓储管理、运输配送绩效指标
- 施工吊篮专项施工方案
- 2025年时事政治考试题库及参考答案(100题)
- 爱笑的虎鲸课件
- 九章怀沙全文课件
- 损失厌恶效应-洞察及研究
- 自闭症中医课件
评论
0/150
提交评论