金蝶中间件校招笔试题.docx
- 文档编号:13061029
- 上传时间:2023-06-10
- 格式:DOCX
- 页数:23
- 大小:23.11KB
金蝶中间件校招笔试题.docx
《金蝶中间件校招笔试题.docx》由会员分享,可在线阅读,更多相关《金蝶中间件校招笔试题.docx(23页珍藏版)》请在冰点文库上搜索。
金蝶中间件校招笔试题
一、单选题(18分,每小题个2分)
1.关于软件测试目,下面观点错误是()
A、将来发现错误而执行程序过程
B、一种好测试用例可以发现至今尚未发现错误
C、证明程序是对的、没有错误
D、一种成功测试用例是发现了至今尚未发现错误测试
2.Given:
Integeri=newInteger(42);
Longl=newLong(42);
Doubled=newDouble(42.0);
WhichexpressionevaluatestoTrue?
A.(i==l)
B.(i==d)
C.(d==1)
D.(i.equals(d))
E.(d.equals(l))
F.(i.equals(l))
G.(l.equals(42L))
3.Whathappenswhenyoutrytocompileandrunthefollowingapplication?
Chooseall
Correctoptions.
1.publicclassZ{
2.publicstaticvoidmain(String[]args){
3.newZ();
4.}
5.
6.Z(){
7.Zalias1=this;
8.Zalias2=this;
9.synchronized(alias1){
10.try{
11.alias2.wait();
12.System.out.println("DONEWAITING");
13.}
14.catch(InterruptedExceptione){
15.System.out.println("INTERRUPTED");
16.}
17.catch(Exceptione){
18.System.out.println("OTHEREXCEPTION");
19.}
20.finally{
21.System.out.println("FINALLY");
22.}
23.}
24.System.out.println("ALLDONE");
25.}
26.}
A.Theapplicationcompilesandprints“DONEWAITING”
B.Theapplicationcompilesbutdoesn’tprintanything
C.Theapplicationcompilesandprint“FINALLY”
D.Theapplicationcompilesandprint“ALLDONE”
E.Theapplicationcompilesandprint“INTERRUPTED”
F.Theapplicationcompilesandprint“DONEWAITING”and“FINALLY”
4.Considerthefollowingclasses:
1.classPerson{
2.publicvoidprintValue(inti,intj){/*.....*/}
3.publicvoidprintValue(inti){/*....*/}
4.}
5.publicclassTeacherextendsPerson{
6.publicvoidprintValue(){/*...*/}
7.publicvoidprintValue(inti){/*...*/}
8.publicvoidprintValue(Stringi){/*...*/}
9.publicstaticvoidmain(Stringargs[]){
10.Persont=newTeacher();
11.charch='y';
12.t.printValue(ch);
13.}
14.}
Whichofthestatementsbelowistrue?
A.Line7willnotcompile,becausevoidmethodscannotbeoverridden
B.Line12willnotcompile,becausethereisnoversionofprintValue()thattakesacharargument
C.Thecodewillcompilebutwillthrowanexceptionatline12atruntime
D.Thestatementonline12willinvokethemethodonline8
E.Thestatementonline12willinvokethemethodonline2
F.Thestatementonline12willinvokethemethodonline3
G.Thestatementonline12willinvokethemethodonline7
5.Considerthefollowingstatement,chooseallcorrectoptions
YouaregivenaclasshierarchywithaninstanceoftheClassDog.TheclassDogisachildof
MammalandtheclassMammalisachildoftheclassVertebrate.TheclassVertebratehasamethodcalledmovewhichprintsoutthestring“move”.TheclassMammaloverridesthismethodandprintsoutthestring”walks”.TheclassDogoverridesthismethodandprintsoutthestring“walksonpaws”.
Givenaninstance(dog)oftheclassDog,howcanyouaccesstheancestormethodmoveinVertebratesoitprintsoutthestring“move”;
A.dog.super().super().move();
B.dog.parent().parent().move();
C.dog.move();
D.noneoftheabove
6.Whatwillhappenwhenyouattempttocompileandrunthefollowingcode.
publicclassTest{
publicstaticvoidmain(Stringargv[]){
HHQht=newHHQ("myname");
ht.start();
}
}
classHHQextendsThread{
privateStringname="";
HHQ(Strings){
name=s;
}
publicvoidrun(){
inner();
System.out.println("finished");
}
publicvoidinner(){
while(true){
try{
System.out.println("waiting");
wait();
}catch(InterruptedExceptionie){
}
System.out.println(name);
notifyAll();
}
}
}
A.Itwillcauseacompiletimeerror
B.Compilationandoutputof“waiting”
C.Compilationandoutputof“waiting”followedby“finished”
D.Runtimeerror,outputof“waiting”andanexceptionwillbethrown
7.Whichofthefollowingmostcloselydescribestheprocessofoverriding?
A.Aclasswiththesamenamereplacesthefunctionalityofaclassdefinedearlierinthehierarchy
B.Amethodwiththesamenamecompletelyreplacesthefunctionalityofamethodearlierinthehierarchy
C.Amethodwiththesamenamebutdifferentparametersgivesmultipleusesforthesamemethodname
D.Aclassispreventedfromaccessingmethodsinitsimmediateancestor
8.Giventhefollowingcode:
1classA{
2publicvoidprocess(){System.out.print("A");}}
3classBextendsA{
4publicvoidprocess()throwsIOException{
5super.process();
6System.out.print("B");
7thrownewIOException();
8}
9publicstaticvoidmain(String[]args){
10try{
11newB().process();
12}catch(IOExceptione){
13System.out.println("Exception");
14}
15}
16}
Whatwillhappenwhenyouattempttocompileandrunit?
A.Theprogramwillrunandoutput“A”,”B”and“Exception”
B.Theprogramwillrunandoutput“A”
C.Theprogramwillrunandoutput“B”and“Exception”
D.Compilationfailsbecauseofanerrorinline11
E.Compilationfailsbecauseofanerrorinline4
F.AnIOExceptionwillthrownatruntime
9.WhatwillhappenwhenyouattempttocompileandrunthefollowingcodeinJDK5environment?
1.publicclassTest{
2.publicstaticvoidincrease(Integeri){
3.i++;
4.}
5.publicstaticvoidmain(Stringargs[]){
6.Integeri=newInteger(0);
7.increase(i);
8.System.out.println(i);
9.}
10.}
A.Compilationfailsbecauseofanerrorinline7
B.Compilationfailsbecauseofanerrorinline3
C.Theprogramwillrunandoutput“1”
D.Theprogramwillrunandoutputarandomnumber
E.Theprogramwillrunandoutput“0”
二、不定项选取题(18分,每小题各2分)
1.下述表达对的有()
A、单元测试应当由试人员进行测试
B、软件质量是不可量化
C、开发人员应当对代码质量负最重要责任
D、软件配备管理好坏对软件最后质量没有影响
E、软件运营性能是由硬件配备所制约,与程序所用数据构造与算法无关
2.Whichofthefollowingdemonstratea“hasa”relationship?
A、publicinterfacePerson{}
publicclassEmployeeextendsPerson{}
B、publicinterfaceShape{}
publicinterfaceRectangleextendsShape{}
C、publicinterfaceColorable{}
publicclassShapeimplementsColorable{}
D、publicclassSpecies{}
publicclassAnimal{
privateSpeciesspecies;
}
E、interfaceComponent{}
classContainerimplementsComponet{
privateComponent[]children;
}
3.Whichofthefollowingaretruefortheclassjava.util.TreeSet?
A.Theelementsinthecollectionareordered
B.Thecollectionisguaranteedtobeimmutable
C.Theelementsinthecollectionareguaranteedtobeunique
D.Theelementsinthecollectionareaccessedusingauniquekey
E.Theelementsinthecollectionareguaranteedtobysynchronized
4.Giventhefollowingcodefragment:
1.publicvoidcreate(){
2.VectormyVect;
3.myVect=newVector();
4.}
Whichofthefollowingstatementaretrue?
A.Thestatementonline2createsanobjectofclassVector
B.Thedeclarationonline2doesnotallocatememoryspaceforthevariablemyVect
C.Thedeclarationonline2allocatesmemoryspaceforareferencetoaVectorobject
D.Thestatementonline3createanobjectofclassVector
E.Thestatementonline3allocatesmemoryspaceforanobjectofclassVector
5.Giventhefollowingcode:
classBase{
staticintoak=99;
}
publicclassDoverdaleextendsBase{
publicstaticvoidmain(Stringargv[]){
Doverdaled=newDoverdale();
d.amethod();
}
publicvoidamethod(){
//Here
}
}
Whichofthefollowingifplacedafterthecomment//Here,willcompileandmodifythevalueofthevariableoak?
A.super.oak=1;
B.oak=33;
C.Base.oak=22;
D.Oak=50.1;
6.Whichofthefollowingstatementsaretrueaboutavariablecreatedwiththestaticmodifier?
A.Onceassignedthevalueofastaticvariablecan’tbealtered
B.Astaticvariablecreatedinamethodwillkeepthesamevaluebetweencalls
C.Onlyoneinstanceofastaticvariablewillexistforanyamountofclassinstances
D.Thestaticmodifiercanonlybeappliedtoaprimitivevalue
7.Giventhefollowingclass:
publicclassA{
publicstaticvoidmain(Stringargv[]){
booleanb1=true;
if((b1==true)||place(true)){
System.out.println("HelloTrue");
}
if(b1|place((String)null)){
System.out.println("HelloNull");
}
}
publicstaticbooleanplace(booleanlocation){
if(location!
=true){
System.out.println("worldTrue");
}
System.out.println("WorldTrue");
returntrue;
}
publicstaticbooleanplace(Stringstr){
if(str==null|str.length()==0){
System.out.println("WorldNull");
}
System.out.println("WorldString");
returntrue;
}
}
Whatwillhappenwhenyouattempttocompileandrunit?
A.Compilefails
B.Outputof“HelloTrue”
C.Outputof“WorldBoolean”followedby“HelloTrue”,”WorldNull”,”WorldString”and“HelloNull”
D.Outputof“HelloTrue”followedby“HelloNull”
E.Outputof“HelloTrue”,thenanexceptionisthrownatruntime
F.Outputof“HelloTrue“followedby“Worldnull”,”WorldString”and“HelloNull”
8.Whichstatementaretrueaboutthegarbagecollectionmechanisms?
A.Thegarbagecollectionmechanismreleasememoryatpredictabletimes
B.Acorrectprogrammustnotdependuponthetimingororderofgarbagecollection
C.Garbagecollectionensuresthataprogramwillnotrunoutofmemoryduringexecution
D.TheprogrammercanindicatethatareferencethroughalocalvariableisnolongergoingtoJavaobjects
E.TheprogrammerhasamechanismthatexplicitlyandimmediatelyfreesthememoryusedbyJavaobjects
F.Thegarbagecollectionsystemneverreclaimsmemoryfromobjectswhilearestillaccessibletorunninguserthreads
9.Whatwillhappenwhenyouattempttocompileandrunthefollowingcode?
1.publicclassTest{
2.publicstaticStringhello(String[]strs,Strings2){
3.strs[0]="<"+strs[0]+">";
4.s2.toUpperCase();
5.returns2;
6.}
7.publicstaticvoidmain(Stringargs[]){
8.Stringa=newString("t");
9.String[]b=newString[]{"t"};
10.Stringc=a.intern();
11.if(a.
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 中间件 笔试
![提示](https://static.bingdoc.com/images/bang_tan.gif)