桂电JAVA题库重点含答案翻译.docx
- 文档编号:25238040
- 上传时间:2023-06-06
- 格式:DOCX
- 页数:31
- 大小:248.32KB
桂电JAVA题库重点含答案翻译.docx
《桂电JAVA题库重点含答案翻译.docx》由会员分享,可在线阅读,更多相关《桂电JAVA题库重点含答案翻译.docx(31页珍藏版)》请在冰豆网上搜索。
桂电JAVA题库重点含答案翻译
1、WhichofthefollowingisnotavalidJavaidentifier?
下列哪个不是一个有效的Java标识符()
A.myValue
B.$_AAA1
C.width
D.m_x
2、Sendingamessagetoanobjectmeansthat:
发送消息,意味着一个对象()
A.Youcallamethodoftheobject.你对象的调用一个方法。
B.Youaccessavariableoftheobject.
C.Both(a)and(b).
D.Neither(a)nor(b).
3、WhichofthefollowingisaScannermethod?
下列哪个是扫描仪的方法?
()
A.nextLine.
B.nextText.
C.nextWord.
D.readNext.
4、WhichisacorrectstaticmethodcallofMathclassmethodsqrt?
这是一个正确的数学类的静态方法调用方法执行?
()
A.sqrt(900);.
B.math.sqrt(900);.
C.Math.sqrt(900);.
D.Mathmath=newMath();math.sqrt(900);.
5、Declaringmainas________allowstheJVMtoinvokemainwithoutcreatinganinstanceoftheclass.宣布主要在允许JVM调用主要没有创建类的实例()
A.public.
B.void.
C.static.
D.final.
6、Considerthearray:
()
s[0]=7
s[1]=0
s[2]=-12
s[3]=9
s[4]=10
s[5]=3
s[6]=6
Thevalueofs[s[6]-s[5]]is:
A.0.
B.3.
C.9.
D.10.
7、Whatdothefollowingstatementsdo?
下面的语句做什么?
()
double[]array;
array=newdouble[14];
A.Createadoublearraycontaining13elements.
B.Createadoublearraycontaining14elements.创建一个数组包含14个元素的两倍。
C.Createadoublearraycontaining15elements.
D.Declarebutdonotcreateadoublearray.
8、The_________ofaclassarealsocalledthepublicservicesorthepublicinterfacethattheclassprovidestoitsclients.类的_____也称为公共服务或类的公共接口提供给它的客户。
()
A.publicconstructors.
B.publicinstancevariables.
C.publicmethods.
D.Alloftheabove.
9、Usingpublicsetmethodsprovidesdataintegrityif:
使用公共设置方法提供数据完整性,如果:
()
A.Theinstancevariablesarepublic.实例变量是公开的。
B.Theinstancevariablesareprivate.
C.Themethodsperformvaliditychecking.执行有效性检查的方法
D.Bothbandc.
10、Whichofthefollowingkeywordsallowsasubclasstoaccessasuperclassmethodevenwhenthesubclasshasoverriddenthesuperclassmethod?
下列哪个关键字允许子类访问一个超类方法即使子类覆盖父类的方法?
()
A.base.
B.this.
C.public.
D.super.
11、Whichmethodchangesthetextthelabeldisplays?
哪个方法改变了文本标签显示?
()
A.changeText.
B.setText.
C.changeLabel.
D.setLabel.
12、A(n)classcannotbeinstantiated.()类不能被实例化。
A.final.
B.concrete.
C.abstract.抽象的,
D.polymorphic.
13、Considertheabstractsuperclassbelow:
()考虑下面的抽象超类
publicabstractclassFoo
{
privateinta;
publicintb;
publicFoo(intaVal,intbVal)
{
a=aVal;
b=bVal;
}//endFooconstructor
publicabstractintcalculate();
}//endclassFoo
AnyconcretesubclassthatextendsclassFoo:
任何具体子类扩展类Foo:
A.Mustimplementamethodcalledcalculate.必须实现一个名为计算的方法。
B.Willnotbeabletoaccesstheinstancevariablea.将无法访问实例变量。
C.Neither(a)nor(b).
D.Both(a)and(b).
14、Whenanexceptionoccursitissaidtohavebeen:
()当异常发生时,据说:
A.caught.
B.thrown.
C.declared.
D.handled.
15、Anuncaughtexception:
()未捕获的异常:
A.isapossibleexceptionthatneveractuallyoccursduringtheexecutionoftheprogram.
B.isanexceptionthatoccursforwhichthematchingcatchclauseisempty.
C.isanexceptionthatoccursforwhichtherearenomatchingcatchclauses.是一个例外,因为没有匹配的条款
D.isanothertermforathrownexception.
16、Whichofthefollowingstatementsistrue?
()下列哪个陈述是正确的?
A.[^Z]isthesameas[A~Y];
B.Both“A*”and“A+”willmatch“AAA”,butonly“A*”willmatchanemptystring.“*”和“+”将匹配“AAA”,但只有“*”将匹配一个空字符串
C.Rangesofcharacterscanberepresentedbyplacinga~betweentwocharacters;
D.Allofabove;
17、Whichofthefollowingclassesisnotusedforfileinput?
()下列哪类不用于文件输入?
A.FileInputStream
B.FileReader
C.ObjectInputStream
D.Formatter格式化程序
18、Menusareattachedtowindowsbycallingmethod()菜单连接到窗口通过调用方法
A.addMenuBar.
B.setJMenuBar.
C.setMenu.
D.addJMenuBar.
19、The________determineswhichthreadrunsnext.()规律决定了哪些线程运行下一个。
A.threadmanager
B.threadscheduler线程管理器
C.threadqueue
D.Noneoftheabove.
20、WhichofthefollowingisnotaGUIcomponent(controlorwidget)?
()下列哪个不是一个GUI组件(控制或部件)?
A.String.
B.Button.
C.Menu.
D.Combobox.
21、WhatisthevalueofresultafterthefollowingJavastatementsexecute?
()什么是价值以下Java语句执行后的结果吗?
inta,b,c,d,result;
a=4;
b=12;
c=37;
d=51;
result=d%a*c+a%b+a;
E.119
F.51
G.127
H.59
22、Whatisthedefaultvalueofareference?
()一个参考的默认值是什么?
A.0.
B."".
C.null.
D.default.
23、Adefaultconstructorhashowmanyparameters?
()一个默认的构造函数参数有多少?
A.0.
B.1.
C.2.
D.Variable.
24、Informationispassedtoamethodin:
()信息被传递给一个方法:
A.themethodname.
B.thatmethod'sreturn.
C.themethodbody.
D.theargumentstothemethod.
25、Anyfielddeclaredwithkeyword________isconstant.()用关键字声明在任何领域都是常数
A.static.
B.const.
C.constant.
D.final.
26、Whichofthefollowinginitializerlistswouldcorrectlysettheelementsofarrayn?
()下列哪个初始化器列表正确设置数组的元素n吗?
A.int[]n={1,2,3,4,5};.
B.arrayn[int]={1,2,3,4,5};.
C.intn[5]={1;2;3;4;5};.
D.intn=newint(1,2,3,4,5);.
27、Considertheprogrambelow:
()考虑下面的程序:
publicclassTest
{
publicstaticvoidmain(String[]args)
{
int[]a;
a=newint[10];
for(inti=0;i a[i]=i+2; intresult=0; for(inti=0;i result+=a[i]; System.out.printf("Resultis: %d\n",result); }//endmain }//endclassTest Theoutputofthisprogramwillbe: 这个程序的输出 A.Resultis: 62. B.Resultis: 64. C.Resultis: 65. D.Resultis: 67. 28、Thestaticmethod________ofclassStringreturnsaformattedString.()静态方法在类的字符串返回一个格式化字符串 A.printf. B.format.格式 C.formatString. D.toFormatString. 29、Whenimplementingamethod,usetheclass’ssetandgetmethodstoaccesstheclass’s________data.()当执行一个方法,使用类的设置和获取方法来访问类的数据了。 () A.public. B.private. C.protected. D.Alloftheabove. 30、Usingtheprotectedkeywordgivesamember: ()使用受保护的关键字给出了一个成员 A.publicaccess. B.packageaccess. C.privateaccess. D.blockscope. 31、EveryclassinJava,except________,extendsanexistingclass.()每一个类在Java中,除了______,扩展了现有的类 A.Integer. B.Object. C.String. D.Class. 32、Ifthesuperclasscontainsonlyabstractmethoddeclarations,thesuperclassisusedfor: ()如果超类只包含抽象方法声明,用于超类 A.Implementationinheritance. B.Interfaceinheritance.接口继承。 C.Both. D.Neither. 33、Considertheabstractsuperclassbelow: ()考虑下面的抽象超类 publicabstractclassFoo { privateinta; publicintb; publicFoo(intaVal,intbVal) { a=aVal; b=bVal; }//endFooconstructor publicabstractintcalculate(); }//endclassFoo AnyconcretesubclassthatextendsclassFoo: 任何具体子类扩展类Foo: A.Mustimplementamethodcalledcalculate.必须实现一个名为计算的方法。 B.Willnotbeabletoaccesstheinstancevariablea.将无法访问实例变量。 C.Neither(a)nor(b). D.Both(a)and(b). 34、Whenanexceptionoccursitissaidtohavebeen: ()当异常发生时,据说: A.caught. B.thrown. C.declared. D.handled. 35、Tocatchanexception,thecodethatmightthrowtheexceptionmustbeenclosedina()捕获到一个异常,代码必须封装在一个可能抛出的异常 A.throwsblock. B.catchblock. C.tryblock. D.finallyblock. 36、Giventhefollowingdeclarations: ()鉴于以下声明: StringBuilderbuffer=newStringBuilder(“TestingTesting”); buffer.setLength(7); buffer.ensureCapacity(5); Whichofthefollowingistrue? A.bufferhaslength15. B.bufferhascontent“Testin”. C.bufferhascapacity31.缓冲区有能力31 D.bufferhascapacity5. 37、Whatdoesthefollowingstatementdo? ()下面的语句是做什么的? Scannerscanner=newScanner(newFile("test.txt")); A.Opensabinaryfileforinput. B.Opensabinaryfileforoutput. C.Opensatextfileforinput. D.Opensatextfileforoutput. 38、Whichcomponentcontainsmenus? ()该组件包含菜单吗? A.Menubutton. B.Titlebar. C.Menubar. D.Combobox. 39、ThefirstargumenttomethodshowMessageDialogspecifies()第一个参数方法showMessageDialog指定 A.thetitle. B.themessage. C.theicon. D.theparentwindow.父窗口。 40、Anewthreadbeginsitslifecyclebytransitioningtothe__________state.()一个新线程开始过渡到它的生命周期的状态才开会 A.runnable. B.waiting. C.terminated. D.new. 41、System.out.print("Hello");() System.out.println("World"); E.HelloWorld F.HelloWorld G.Hello World H.World Hello 42、EveryJavaapplicationiscomposedofatleastone: ()每个Java应用程序都是由至少一个 E.localvariable F.instancevariable G.publicclassdeclaration公共类声明 H.importedclass 43、Whichofthefollowingisavalidfullyqualifiedname? ()以下是一个有效的完全限定名称呢? E.Scanner. F.java.Scanner. G.util.Scanner. H.java.util.Scanner. 44、WhichofthefollowingmethodsisnotintheMathclass? ()下列哪个方法不是数学课? E.ceil. F.abs. G.parseInt. H.log. 45、Declaringmainas________allowstheJVMtoinvokemainwithoutcreatinganinstanceoftheclass.()宣布主要在允许JVM调用主要没有创建类的实例。 () E.public. F.void. G.static. H.final. 46、Arraysare: () E.variable-lengthentities. F.fixed-lengthentities.固定长度的实体。 G.datastructuresthatcontainupto10relateddataitems. H.usedtodrawasequenceoflines,or“rays.” 47、Aprogrammermustdothefollowingbeforeusinganarray: ()一个程序员在使用前必须做以下数组: E.declarethenreferencethearray. F.createthendeclarethearray. G.createthenreferencethearray. H.declarethencreatethearray.然后创建数组。 48、Whichofthefollowingshouldusuallybeprivate? ()下列哪个通常应该私人吗? E.Methods. F.Constructors. G.Variables(orfields).变量(或领域)。 H.Alloftheabove. 49、Whichofthefollowingstatementsistrue? () A.Methodsandinstancevariablescanbothbeeitherpublicorprivate.方法和实例变量都可以公开或私有的
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- JAVA 题库 重点 答案 翻译
![提示](https://static.bdocx.com/images/bang_tan.gif)