您好,欢迎访问三七文档
当前位置:首页 > IT计算机/网络 > 数据挖掘与识别 > 大数据基础技能试题及答案
1Java基础1.Whichofthefollowingwillcompilecorrectly?A)floatf=10f;B)floatf=10.1;C)floatf=10.1f;D)byteb=10b;2.WhichdeclarationsofidentifiersarelegalA.$personsB.TwoUsersC.*pointD.thisE._endline3.WhichstatementofassigningalongtypevariabletoahexadecimalvalueiscorrectA.longnumber=345L;B.longnumber=0345;C.longnumber=0345L;D.longnumber=0x345L4.WhichofthefollowingfragmentsmightcauseerrorsA.Strings=Gonewiththewind;Stringt=good;Stringk=s+t;B.Strings=Gonewiththewind;Stringt;t=s[3]+one;C.Strings=Gonewiththewind;Stringstandard=s.toUpperCase();D.Strings=homedirectory;Stringt=s-directory;5.Whicharesyntacticallyvalidstatementat//pointxclassPerson{privateinta;publicintchange(intm){returnm;}}2publicclassTeacherextendsPerson{publicintb;publicstaticvoidmain(Stringarg[]){Personp=newPerson();Teachert=newTeacher();inti;//pointx}}A.i=m;B.i=b;C.i=p.a;D.i=p.change(30);E.i=t.b.6.Whichlayoutmanagerisusedwhentheframeisresizedthebuttons'spositionintheFramemightbechangedA.BorderLayoutB.FlowLayoutC.CardLayoutD.GridLayout7.Giventhefollowingcodefragment:1)publicvoidcreate(){2}VectormyVect;3}myVect=newVector();4}}WhichofthefollowingstatementsaretrueA.Thedeclarationonline2doesnotallocatememoryspaceforthevariablemyVect.B.Thedeclarationonline2allocatesmemoryspaceforareferencetoaVectorobject.C.Thestatementonline2createsanobjectofclassVector.D.Thestatementonline3createsanobjectofclassVector.E.Thestatementonline3allocatesmemoryspaceforanobjectofclassVector8.Whichofthefollowingansweriscorrecttoexpressthevalue8inoctalnumberA.010B.0x10C.08D.0x89.WhicharenotJavakeywordsA.TRUEB.sizeofC.const3D.superE.void10.WhichofthefollowingstatementsaretrueA.Theequals()methoddeterminesifreferencevaluesrefertothesameobject.B.The==operatordeterminesifthecontentsandtypeoftwoseparateobjectsmatch.C.Theequals()methodreturnstrueonlywhenthecontentsoftwoobjectsmatch.D.TheclassFileoverridesequals()toreturntrueifthecontentsandtypeoftwoseparateobjectsmatch.11.WhichstatementsaboutinheritancearetrueA.InJavaprogramminglanguageonlyallowssingleinheritance.B.InJavaprogramminglanguageallowsaclasstoimplementonlyoneinterface.C.InJavaprogramminglanguageaclasscannotextendaclassandimplementainterfacetogether.D.InJavaprogramminglanguagesingleinheritancemakescodemorereliable.12.1)classPerson{2}publicvoidprintValue(inti,intj){/*…*/}3}publicvoidprintValue(inti){/*...*/}4}}5)publicclassTeacherextendsPerson{6}publicvoidprintValue(){/*...*/}7}publicvoidprintValue(inti){/*...*/}8}publicstaticvoidmain(Stringargs[]){9}Persont=newTeacher();10}t.printValue(10);11}}12}}Whichmethodwillthestatementonline10callA.online2B.online3C.online6D.online713.WhicharenotJavaprimitivetypesA.shortB.BooleanC.unitD.float414、Themethodresume()isresponsibleforresumingwhichthread'sexecutionA.Thethreadwhichisstoppedbycallingmethodstop()B.Thethreadwhichisstoppedbycallingmethodsleep()C.Thethreadwhichisstoppedbycallingmethodwait()\D.Thethreadwhichisstoppedbycallingmethodsuspend()15.WhichofthefollowingrangeofintiscorrectA.-2^7–2^7-1B.0–2^32-1C.-2^15–2^15-1D.-2^31–2^31-116.WhichkeywordshouldbeusedtoenableinteractionwiththelockofanobjectTheflagallowsexclusiveaccesstothatobject.A.transientB.synchronizedC.serializeD.static17.Whichisthereturntypeofthemethodmain()A.intB.voidC.booleanD.static18.Giventhefollowingcode:if(x0){System.out.println(first);}elseif(x-3){System.out.println(second);}else{System.out.println(third);}WhichrangeofxvaluewouldprintthestringsecondA.x0B.x-3C.x=-3D.x=0&x-319、Whichofthefollowingansweriscorrecttoexpressthevalue10inhexadecimalnumberA.0xAB.0x16C.0AD.01620.WhichstatementsaboutthegarbagecollectionaretrueA.Theprogramdevelopermustcreateathreadtoberesponsibleforfreethememory.5B.Thegarbagecollectionwillcheckforandfreememorynolongerneeded.C.Thegarbagecollectionallowtheprogramdevelopertoexplicityandimmediatelyfreethememory.D.Thegarbagecollectioncanfreethememoryusedjavaobjectatexpecttime.21、Giventhefollowingcode:1)publicclassTest{2}intm,n;3}publicTest(){}4}publicTest(inta){m=a;}5}publicstaticvoidmain(Stringarg[]){6}Testt1,t2;7}intj,k;8}j=0;k=0;9}t1=newTest();10}t2=newTest(j,k);11}}12}}WhichlinewouldcauseoneerrorduringcompilationA.line3B.line5C.line6D.line1022、Giventheuncompletedcodeofaclass:classPerson{Stringname,department;intage;publicPerson(Stringn){name=n;}publicPerson(Stringn,inta){name=n;age=a;}publicPerson(Stringn,Stringd,inta){//doingthesameastwoargumentsversionofconstructor//includingassignmentname=n,age=adepartment=d;}}Whichexpressioncanbeaddedatthedoingthesameas...partoftheconstructorA.Person(n,a);B.this(Person(n,a));C.this(n,a);D.this(name,age).623、WhichofthefollowingstatementsaboutvariablesandtheirscopesaretrueA.Instancevariablesaremembervariablesofaclass.B.Instancevariablesaredeclaredwiththestatickeyword.C.Localvariablesdefinedinsideamethodarecreatedwhenthemethodisexecuted.D.Localvariablesmustbeinitializedbeforetheyareused.24、publicvoidtest(){try{oneMethod();System.out.println(condition1);}catch(ArrayIndexOutOfBoundsExceptione){System.out.println(condition2);}catch(Exceptione){System.out.println(condi
本文标题:大数据基础技能试题及答案
链接地址:https://www.777doc.com/doc-3298030 .html