




已阅读5页,还剩8页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
选择题 1:Which of the following answer is correct to express the value 8 in octal number? A.010 B.0x10 C.08 D.0x8 2: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 3: Givethefollowingjavaclass: publicclassExample staticintx=newint15; publicstaticvoidmain(Stringargs) System.out.println(x5); Whichstatementiscorrected?Give the following java class:public class Examplestatic int x=new int15;public static void main(String args)System.out.println(x5);Which statement is corrected?A.When compile, some error will occur. B.When run, some error will occur. C.Output is zero. D.Output is null. 4: Givethefollowingjavasourcefragement: /pointx publicclassInteresting /dosomething WhichstatementiscorrectlyJavasyntaxatpointx?Give the following java source fragement:/point xpublic class Interesting/do somethingWhich statement is correctly Java syntax at point x? A.public class MyClass/do other thing B.static int PI=3.14 C.class MyClass/do something D.none 5: Whatwillbetheresultofexecutingthefollowingcode? booleana=true; booleanb=false; booleanc=true; if(a=true) if(b=true) if(c=true)System.out.println(Somethingsaretrueinthisworld); elseSystem.out.println(Nothingistrueinthisworld!); elseif(a&(b=c)System.out.println(Itstooconfusingtotellwhatistrueandwhatisfalse); elseSystem.out.println(Heythiswontcompile); 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 6: Whatwillbetheresultofexecutingthefollowingcode? /Filename;SuperclassX.java packagepackageX; publicclassSuperclassX protectedvoidsuperclassMethodX() intsuperclassVarX; /FilenameSubclassY.java 1.packagepackageX.packageY; 2. 3.publicclassSubclassYextendsSuperclassX 4. 5.SuperclassXobjX=newSubclassY(); 6.SubclassYobjY=newSubclassY(); 7.voidsubclassMethodY() 8. 9.objY.superclassMethodX(); 10.inti; 11.i=objY.superclassVarX; 12. 13. Choices:What will be the result of executing the following code? / Filename; SuperclassX.javapackage packageX; public class SuperclassXprotected void superclassMethodX()int superclassVarX; / Filename SubclassY.java1.package packageX.packageY;2.3.public class SubclassY extends SuperclassX4.5.SuperclassX objX = new SubclassY();6.SubclassY objY = new SubclassY();7.void subclassMethodY()8.9.objY.superclassMethodX();10.int i;11.i = objY.superclassVarX;12.13. Choices:A.Compilation error at line 5 B.Compilation error at line 9 C.Runtime exception at line 11 D.None of these 7:在下述选项时,没有构成死循环的程序是 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; 8:Which fragments are not correct in Java source file? A.package testpackage; public class Test/do something. B.import java.io.*; package testpackage; public class Test/ do something. C.import java.io.*; class Person/ do something. public class Test/ do something. D.import java.io.*; import java.awt.*; public class Test/ do something. 9: 下述程序代码中有语法错误的行是()。 inti,ia10,ib10;/*第一行*/for(i=0;i=9;i+)/*第2行*/iai=0;/*第3行*/ib=ia;/*第4行*/下述程序代码中有语法错误的行是( )。int i,ia10,ib10; /*第一行*/for (i=0;i0) System.out.println(“Finish”); Whichwellbeoutput:Give the following code:public class Examplepublic static void main(String args )int l=0;doSystem.out.println(“Doing it for l is:”+l);while(-l0)System.out.println(“Finish”);Which well be output: A.Doing it for l is 3 B.Doing it for l is 1 C.Doing it for l is 2 D.Doing it for l is 0 17: ThefollowingcodeisentirecontentsofafilecalledExample.java,causespreciselyoneerrorduringcompilation: classSubClassextendsBaseClass classBaseClass() Stringstr; publicBaseClass() System.out.println(“ok”); publicBaseClass(Strings) str=s; publicclassExample publicvoidmethod() SubClasss=newSubClass(“hello”); BaseClassb=newBaseClass(“world”); Whichlinewouldbecausetheerror?The following code is entire contents of a file called Example.java,causes precisely one error during compilation: class SubClass extends BaseClass class BaseClass() String str; public BaseClass() System.out.println(“ok”); public BaseClass(String s) str=s; public class Example public void method() SubClass s=new SubClass(“hello”); BaseClass b=new BaseClass(“world”); Which line would be cause the error? A.9 B.10 C.11 D.12 18:设有变量说明语句int a=1,b=0; 则执行以下程序段的输出结果为( )。 switch (a) case 1: switch (b) case 0:printf(*0*);break; case 1:printf(*1*);break; case 2:printf(*2*);break; printf(n); A.*0* B.*0*2* C.*0*1*2* D.有语法错误 19:What is written to the standard output given the following statement:System.out.println(4|7); Select the right answer: A.4 B.5 C.6 D.7 20:Which is the main() method return of a application? A.String B.byte C.char D.void 21:Math.round(11.5)等於多少? A.11 B.12 C.11.5 D.none 简答题 22:说出ArrayList,Vector, LinkedList的存储性能和特性。 23:找出32位数中是回文数,且其开方为整数的数。 24:X博士是一个研究儿童智力开发方法的科学家,他为幼儿教育领域做出了许多贡献。最近,X博士正在研究一种适合儿童的游戏,用以辅助发展儿童的观察力、注意力和思维能力。经过连日的构思,X博士终于设计出了一种游戏:彩球游戏。 彩球游戏是一种单人参与的游戏,游戏首先给出一串由许多不同颜色的小球组成的小球序
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 销售咨询运营方案范文
- 云浮商场促销活动策划方案
- 某私立学校关于人工智能教育教学试点工作总结报告
- 教代会民主评议学校领导干部暂行办法
- 农业咨询调查方案范文
- 大连立体植物墙施工方案
- 医疗健康产业新动能前景展望
- 电商平台电商生态圈构建
- 关于举办第六届高效先进破碎筛分与磨矿分级技术交
- 巡察财务方面存在的问题及整改措施
- 第五讲铸牢中华民族共同体意识-2024年形势与政策
- 医学伦理学全套课件
- 车用驱动电机原理与控制基础(第2版)课件:三相交流绕组及其磁场
- 加油站安全费用提取、使用台账
- 高考政治一轮复习:统编版必修1《中国特色社会主义》必背考点提纲填空练习版(含答案)
- 2025届高考数学一轮复习建议-函数与导数专题讲座课件
- 近代中国交通工具变迁史说课材料
- 《中华民族一家亲-同心共筑中国梦》队会课件
- 2025届高考试题原创命题比赛说题稿
- 资产负债管理与精算风险控制
- 小学道法小课题研究活动记录
评论
0/150
提交评论