




已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
选择题 1:Which statement about listener is true? A.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 2:以下的C程序代码片段运行后C和d的值分别是多少 Int a =1,b =2; Int c,d; c =(a&b)&a; d =(a&b)&a; A.0,0 B.0,1 C.1,0 D.1,1 3: 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) 4:Which is the main() method return of a application? A.String B.byte C.char D.void 5: 1. Strings=”ExampleString”;Whichoperationisnotlegal?String s=”Example String”;Which operation is not legal?A.int i=s.length(); B.s3=”x”; C.String short_s=s.trim(); D.String t=”root”+s; 6:软件生命周期的瀑布模型把软件项目分为3个阶段、8个子阶段,以下哪一个是正常的开发顺序? A.计划阶段、开发阶段、运行阶段 B.设计阶段、开发阶段、编码阶段 C.设计阶段、编码阶段、维护阶段 D.计划阶段、编码阶段、测试阶段 7: 1. Whatwillhappenwhenyouattempttocompileandrunthefollowingcode? 2. 3. classBase 4. 5. 6. 7. inti=99; 8. 9. publicvoidamethod() 10. 11. 12. 13. System.out.println(Base.amethod(); 14. 15. 16. 17. Base() 18. 19. 20. 21. amethod(); 22. 23. 24. 25. 26. 27. publicclassDerivedextendsBase 28. 29. 30. 31. inti=-1; 32. 33. 34. 35. publicstaticvoidmain(Stringargv) 36. 37. 38. 39. Baseb=newDerived(); 40. 41. System.out.println(b.i); 42. 43. b.amethod(); 44. 45. 46. 47. publicvoidamethod() 48. 49. 50. 51. System.out.println(Derived.amethod(); 52. 53. 54. 55. 56. 57. Choices:What will happen when you attempt to compile and run the following code? class Base int i = 99; public void amethod() System.out.println(Base.amethod(); Base() amethod(); public class Derived extends Baseint i = -1; public static void main(String argv) Base b = new Derived(); System.out.println(b.i); b.amethod(); public void amethod() System.out.println(Derived.amethod(); Choices:A.Derived.amethod() -1 Derived.amethod() B.Derived.amethod() 99 C.Compile time error D.Derived.amethod() 8:Which statement about the garbage collection mechanism are true? A.Garbage collection require additional programe code in cases where multiple threads are running. B.The programmer can indicate that a reference through a local variable is no longer of interest. C.The programmer has a mechanism that explicity and immediately frees the memory used by Java objects. D.The garbage collection mechanism can free the memory used by Java Object at explection time. 9: 1. 给出下面的代码片断。下面的哪些陈述为错误的? 2. 1)publicvoidcreate() 3. 2)VectormyVect; 4. 3)myVect=newVector(); 5. 4)给出下面的代码片断。下面的哪些陈述为错误的?1) public void create() 2) Vector myVect;3) myVect = new Vector();4) A.第二行的声明不会为变量myVect分配内存空间。 B.第二行语句创建一个Vector类对象。 C.第三行语句创建一个Vector类对象。 D.第三行语句为一个Vector类对象分配内存空间 10: Consider the class hierarchy shown below: - class FourWheeler implements DrivingUtilities class Car extends FourWheeler class Truck extends FourWheeler class Bus extends FourWheeler class Crane extends FourWheeler - Consider the following code below: 1.DrivingUtilities du; 2.FourWheeler fw; 3.Truck myTruck = new Truck(); 4.du = (DrivingUtilities)myTruck; 5.fw = new Crane(); 6.fw = du; Which of the statements below are true? Choices: A.Line 4 will not compile because an interface cannot refer to an object. B.The code will compile and run. C.The code will not compile without an explicit cast at line 6, because going down the hierarchy without casting is not allowed. D.The code will compile if we put an explicit cast at line 6 but will throw an exception at runtime. 11:在软件生命周期中,下列哪个说法是不准确的? A.软件生命周期分为计划、开发和运行三个阶段 B.在计划阶段要进行问题焉醛和需求分析 C.在开发后期要进行编写代码和软件测试 D.在运行阶段主要是进行软件维护 12:在下述选项时,没有构成死循环的程序是 A.int i=100 while (1) i=i%100+1; if (i100) break; B.for (;); C.int k=1000; do +k; while(k=10000); D.int s=36; while (s);-s; 13:Which declares for native method in a java class corrected? A.public native void method() B.public native void method(); C.public native method(); D.public void native method(); 14: 1. Whatwillbetheresultofexecutingthefollowingcode? 2. booleana=true; 3. booleanb=false; 4. booleanc=true; 5. if(a=true) 6. if(b=true) 7. if(c=true)System.out.println(Somethingsaretrueinthisworld); 8. elseSystem.out.println(Nothingistrueinthisworld!); 9. elseif(a&(b=c)System.out.println(Itstooconfusingtotellwhatistrueandwhatisfalse); 10. elseSystem.out.println(Heythiswontcompile); 11. 12. Choices:What will be the result of executing the following code? boolean a = true; boolean b = false; boolean c = true; if (a = true) if (b = true) if (c = true) System.out.println(Some things are true in this world); else System.out.println(Nothing is true in this world!); else if (a & (b = c) System.out.println(Its too confusing to tell what is true and what is false); else System.out.println(Hey this wont compile); Choices:A.The code wont compile B.Some things are true in this world will be printed C.Hey this wont compile will be printed D.None of these 15: 1. 下述程序代码中有语法错误的行是()。 2. inti,ia10,ib10;/*第一行*/3. for(i=0;i=9;i+)/*第2行*/4. iai=0;/*第3行*/5. ib=ia;/*第4行*/下述程序代码中有语法错误的行是( )。int i,ia10,ib10; /*第一行*/for (i=0;i=9;i+) /*第2行*/ iai=0; /*第3行*/ib=ia; /*第4行*/A.第1行 B.第2行 C.第3行 D.第4行 16: 1. Whatresultsfromattemptingtocompileandrunthefollowingcode? 2. 3. publicclassTernary 4. 5. 6. 7. publicstaticvoidmain(Stringargs) 8. 9. 10. 11. inta=5; 12. 13. System.out.println(Valueis-+(a5)?9.9:9); 14. 15. 16. 17. 18. 19. Choices:What results from attempting to compile and run the following code? public class Ternarypublic static void main(
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 公司质量事故管理制度
- 公司资产购置管理制度
- 监理部年度工作总结10篇
- 江苏开放大学2025年春财务报表分析第一次模拟练习题
- 2025长途货车买卖合同书
- 2025合同范本房产独家代理协议样本
- 河南省驻马店市2024-2025学年高二下册3月月考数学试卷1附解析
- 安徽省六安市舒城县2024-2025学年高二下册期中阶段质量检测数学试卷附解析
- 2024年宁夏残疾人康复中心招聘真题
- 身份验证漏洞利用基础知识点归纳
- 《供应链管理》期末考试复习题库(含答案)
- 易制毒化学品安全管理培训
- Unit6 Presenting ideas-Project 课件-高中英语外研版必修第一册
- 北京市朝阳区招聘社区工作者考试试卷真题及答案2022
- 技术营销培训
- 气瓶的使用操作规程
- 江苏南京市北京东路小学四年级数学下册期末复习试卷(二)及答案
- 浙江中考生物知识点大全
- 金属非金属矿山安全标准化讲义
- 一人力资源转型和价值
- 机房设备安装工程及移动通信工程施工工艺图解
评论
0/150
提交评论