版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、姓名:_ 班级:_ 学号:_-密-封 -线- java题库:格林模拟试题三(上)考试时间:120分钟 考试总分:100分题号一二三四五总分分数遵守考场纪律,维护知识尊严,杜绝违纪行为,确保考试结果公正。questions question1) whichofthefollowingarelegalstatements? 1)floatf=1/3; 2)inti=1/3; 3)floatf=1.01; 4)doubled=999d; question2) whichofthefollowingarejavakeywords? 1)null 2)new 3)instanceof 4)wend qu
2、estion3) whichofthefollowingarevalidstatements? 1)system.out.println(1+1); 2)inti=2+2; 3)strings=“on”+one; 4)byteb=255; question4) whichofthefollowingstatementsaretrue? 1)thegarbagecollectionalgorithminjavaisvendorimplemented 2)thesizeofprimitivesisplatformdependent 3)thedefaulttypeforanumericallite
3、ralwithdecimalcomponentisafloat. 4)youcanmodifythevalueinaninstanceoftheintegerclasswiththesetvaluemethod question5) whichofthefollowingaretruestatements? 1)i/oinjavacanonlybeperformedusingthelistenerclasses 2)therandomaccessfileclassallowsyoutomovedirectlytoanypointafile. 3)thecreationofanamedinsta
4、nceofthefileclasscreatesamatchingfileintheunderlyingoperatingsystemonlywhentheclosemethodiscalled. 4)thecharacteristicsofaninstanceofthefileclasssuchasthedirectoryseparator,dependonthecurrentunderlyingoperatingsystem question6) whichofthefollowingstatementsaretrue? 1)theinstanceofoperatorcanbeusedto
5、determineifareferenceisaninstanceofaclass,butnotaninterface. 2)theinstanceofoperatorcanbeusedtodetermineifareferenceisaninstanceofaparticularprimitivewrapperclass 3)theinstanceofoperatorwillonlydetermineifareferenceisaninstanceofaclassimmediatelyaboveinthehierarchybutnofurtheruptheinheritancechain 4
6、)theinstanceofoperatorcanbeusedtodetermineifonereferenceisofthesameclassasanotherreferencethus question7) whichofthefollowingstatementsaretrue? 1)aninterfacecanonlycontainmethodandnotvariables 2)interfacescannothaveconstructors 3)aclassmayextendonlyoneotherclassandimplementonlyoneinterface 4)interfa
7、cesarethejavaapproachtoaddressingitslackofmultipleinheritance,butrequireimplementingclassestocreatethefunctionalityoftheinterfaces. question8) whichofthefollowingarevalidstatements 1)publicclassmycalcextendsmath 2)math.max(s); 3)math.round(9.99,1); 4)math.mod(4,10); question9) whichofthefollowingare
8、methodsoftherunnableinterface 1)run 2)start 3)yield 4)stop转 question10) whichofthefollowingstatementsaretrue? 1)abytecanrepresentbetween-128to127 2)abytecanrepresentbetween-127to128 3)abytecanrepresentbetween-256to256 4)acharcanrepresentbetween-2x2pow162x2pow16-1 question11) whatwillhappenwhenyouatt
9、empttocompileandrunthefollowingcode classbase publicvoidbase() system.out.println(“base”); publicclassinextendsbase publicstaticvoidmain(stringargv) ini=newin(); 1)compiletimeerrorbaseisakeyword 2)compilationandnooutputatruntime 3)outputofbase 4)runtimeerrorbasehasnovalidconstructor question12) youh
10、aveapublicclasscalledmyclasswiththemainmethoddefinedasfollows publicstaticvoidmain(stringparm) system.out.println(parm0); ifyouattempttocompiletheclassandruntheprogramasfollows javamyclasshello whatwillhappen? 1)compiletimeerror,mainisnotcorrectlydefined 2)runtimeerror,mainisnotcorrectlydefined 3)co
11、mpilationandoutputofjava 4)compilationandoutputofhello question13) whichofthefollowingstatementsaretrue? 1)ifaclasshasanyabstractmethodsitmustbedeclaredabstractitself. 2)allmethodsinanabstractclassmustbedeclaredasabstract 3)whenappliedtoaclass,thefinalmodifiermeansitcannotbesub-classed 4)transientan
12、dvolatilearejavamodifiers question14) whichofthefollowingarevalidmethods? 1)publicstaticnativevoidamethod() 2)publicstaticvoidamethod() 3)privateprotectedvoidamethod() 4)staticnativevoidamethod(); question15) whichofthefollowingstatementsaretrue? 1)constructorscannothaveavisibilitymodifier 2)constru
13、ctorscanbemarkedpublicandprotected,butnotprivate 3)constructorscanonlyhaveaprimitivereturntype 4)constructorsarenotinheritedquestion16) whatwillhappenwhenyouattempttocompileandrunthefollowingclass? classbase base(inti) system.out.println(“base”); classsevernextendsbase publicstaticvoidmain(stringarg
14、v) severns=newsevern(); voidsevern() system.out.println(“severn”); 1)compilationandoutputofthestring”severn”atruntime 2)compiletimeerror 3)compilationandnooutputatruntime 4)compilationandoutputofthestring”base” question17) whichofthefollowingstatementsaretrue? 1)staticmethodsdonothaveaccesstotheimpl
15、icitvariablecalledthis 2)astaticmethodmaybecalledwithoutcreatinganinstanceofitsclass 3)astaticmethodmaynotbeoverridentobenon-static 4)astaticmethodmaynotbeoverloaded question18) whichofthefollowingwillcompilewithouterror? 1) charc=1; system.out.println(c1); 2) integeri=integer(“1”); system.out.print
16、ln(i1); 3) inti=1; system.out.println(i1); 4) inti=1; system.out.println(i1); question19) whichofthefollowingaretrue? 1)acomponentmayhaveonlyoneeventlistenerattachedatatime 2)aneventlistenermayberemovedfromacomponent 3)theactionlistenerinterfacehasnocorrespondingadapterclass 4)theprocessingofanevent
17、listenerrequiresatry/catchblockquestion20) whichofthefollowingarejavakeywords? 1)sizeof 2)main 3)transient 4)volatile question21) whichofthefollowingstatementsaretrue? 1)thedefaultconstructorhasareturntypeofvoid 2)thedefaultconstructortakesaparameterofvoid 3)thedefaultconstructortakesnoparameters 4)
18、thedefaultconstructorisnotcreatediftheclasshasanyconstructorsofitsown. question22) whichofthefollowingstatementsaretrue? 1)allofthevariablesinaninterfaceareimplicitlystatic 2)allofthevariablesinaninterfaceareimplicitlyfinal 3)allofthemethodsinaninterfaceareimplicitlyabstract 4)amethodinaninterfaceca
19、naccessclasslevelvariables question23) whichofthefollowingstatementsaretrue? 1)thestringclassisimplementedasachararray,elementsareaddressedusinglwhichofthefollowingstatementsaretrue? 1)amethodinaninterfacemustnothaveabody 2)aclassmayextendoneotherclassplusatmostoneinterface 3)aclassmayextendsatmosto
20、neotherclassplusimplementmanyinterfaces 4)anclassaccessesaninterfaceviathekeyworduses question25) whichofthefollowingstatementsaretrue? 1)thefollowingstatementwillproducearesultof1.system.out.println(-12); 2)performinganunsignedleftshift()onanegativenumberwillalwaysproduceanegativenumberresult 3)the
21、followingstatementwillproducearesultofzero,system.out.println(11); 4)allthejavaintegraltypesaresignednumbers question26) whichofthefollowingstatementsaretrue? 1)theelementsinajavaarraycanonlybeofprimitivetypes,notobjects 2)arrayselementsareinitializedtodefaultvalueswherevertheyarecreatedusingthekewo
22、rdnew 3)anarraymaybedynamicallyresizedusingthesetsizemethod 4)youcanfindoutthesizeofanarrayusingthesizemethod question27) giventhefollowingclass publicclassombersley publicstaticvoidmain(stringargv) booleanb1=true; if(b1=true)|place(true) system.out.println(“hellocrowle”); publicstaticbooleanplace(b
23、ooleanlocation) if(location=true) system.out.println(“borcetshire”); system.out.println(“powick”); returntrue; whatwillhappenwhenyouattempttocompileandrunit? 1)compiletimeerror 2)outputof”hellocrowle” 3)outputofborcetshireandpowickfollowedby”hellocrowle” 4)nooutput question28) youaregivenaclasshiera
24、rchywithaninstanceoftheclassdog.theclassdogisachildofmammalandtheclassmammalisachildoftheclassvertebrate.theclassvertebratehasamethodcalledmovewhichprintsoutthestring”move”.theclassmammaloverridesthismethodandprintsoutthestring”walks”.theclassdogoverridesthismethodandprintsoutthestring”walksonpaws”.givenaninstanceoftheclassdog,.howcanyouaccesstheance
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026转业军官统一考试(公共基础知识)题库及答案(广东汕尾)
- 2026年住房和城乡建设领域现场专业人员考试装饰装修施工员专业管理实务考前冲刺试题及答案
- 临床疗效与安全性分析-洞察与解读
- 智能化多式联运协同调度系统研究-洞察与解读
- 3D打印技术在提高运动员表现中的影响-洞察与解读
- 2026年四川省省直机关遴选和选调公务员行政职业能力测验综合练习题及答案
- 段式城市规划中的生态系统修复风险评估-洞察与解读
- 2026年陕西省机关事业单位遴选(选聘)工作人员考试(公共基础知识)冲刺试题及答案
- 2026年内蒙古阿拉善盟公开遴选公务员综合类自测试题及答案解析
- 2026年教师进城选调教育综合知识试题及答案
- 湖南省2026年全省政工专业知识考试(政治+中国近现代史)试题解析及核心考点
- 分班考小升初 2026年辽宁省大连市金普新区语文仿真模拟试卷 有答案
- 第一章特殊平行四边形-问题解决活动:作内嵌于正方形的正八边形2026-2027学年北师大版数学九年级上册
- 急性心肌梗死患者的早期识别与处理
- 2026-2030中国咖啡液市场销售量预测与投资前景深度研究研究报告
- 2026年今年征兵心理测试题及答案
- 临床机械通气的护理与监测要点
- 2026江苏徐州市新盛集团下属城商集团招聘12人备考题库及参考答案详解一套
- 2026年黑龙江哈尔滨第三中学高三第一次模拟考试数学试题含答案解析精校版
- 医保飞行检查培训
- 《眼科临床诊疗指南(2025版)》
评论
0/150
提交评论