Java期末练习卷附答案_第1页
Java期末练习卷附答案_第2页
Java期末练习卷附答案_第3页
Java期末练习卷附答案_第4页
Java期末练习卷附答案_第5页
已阅读5页,还剩17页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Java期末练习卷附答案单选题(总共40题)1.单选题Theoutputfromthefollowingcodeis__________.()

Java.util.ArrayList<String>list=newjava.util.ArrayList<String>();

List.add("NewYork");

Java.util.ArrayList<String>list1=list;

List.add("Atlanta");

List1.add("Dallas");

System.out.println(list1);(1分)A、[NewYork]B、[NewYork,Atlanta]C、[NewYork,Atlanta,Dallas]D、[NewYork,Dallas]答案:C解析:

暂无解析2.单选题Theaverage-timecomplexityformergesortis_________.()(1分)A、O(1)B、O(logn)C、O(n)D、O(nlogn)E、O(n*n)答案:D解析:

暂无解析3.单选题Amethodthatisassociatedwithanindividualobjectiscalled__________.()(1分)A、astaticmethodB、aclassmethodC、aninstancemethodD、anobjectmethod答案:C解析:

暂无解析4.单选题WhichofthefollowingareJavakeywords?()(1分)A、instanceOfB、instanceofC、castD、casting答案:B解析:

暂无解析5.单选题Whichmethoddoyouusetotestifanelementisinasetorlistnamedx?()(1分)A、(elementinstanceofList)||(elementinstanceofSet)B、x.in(element)C、x.contain(element)D、x.contains(element)E、x.include(element)答案:D解析:

暂无解析6.单选题Whatistheoutputofthefollowingcode?()

PublicclassTest{

Publicstaticvoidmain(String[]args){

Strings1=newString("WelcometoJava!");

Strings2=newString("WelcometoJava!");

If(s1==s2)

System.out.println("s1ands2referencetothesameStringobject");

Else

System.out.println("s1ands2referencetodifferentStringobjects");

}

}(1分)A、s1ands2referencetothesameStringobjectB、s1ands2referencetodifferentStringobjects答案:B解析:

暂无解析7.单选题SupposeList<String>list=newArrayList<String>.Whichofthefollowingoperationsarecorrect?()(1分)A、list.add("Red");B、list.add(newInteger(100));C、list.add(newjava.util.Date());D、list.add(newArrayList());答案:A解析:

暂无解析8.单选题Does<?superNumber>representasuperclassofNumber?()(1分)A、YesB、No答案:A解析:

暂无解析9.单选题HowmanytimesistherecursivemoveDisksmethodinvokedfor3disks?()(1分)A、3B、7C、10D、14答案:B解析:

暂无解析10.单选题Theworst-timecomplexityforinsertionsortis_____________.()(1分)A、O(1)B、O(logn)C、O(n)D、O(nlogn)E、O(n*n)答案:E解析:

暂无解析11.单选题ToemptyaCollectionoraMap,youusethe__________method.()(1分)A、emptyB、clearC、zeroD、setEmpty答案:B解析:

暂无解析12.单选题Whatisoutputofthefollowingcode:()

PublicclassTest{

Publicstaticvoidmain(String[]args){

Int[]x={120,200,016};

For(inti=0;i<x.length;i++)

System.out.print(x[i]+"");

}

}(1分)A、12020016B、12020014C、12020020D、016isacompileerror.Itshouldbewrittenas16.答案:B解析:

暂无解析13.单选题Tofindamaximumobjectinanarrayofstrings()g点,String[]names={"red","green","blue"}),use(D)(1分)A、Arrays.max(names)B、Arrays.sort(names)C、Collections.max(names)D、Collections.max(Arrays.asList(names))E、Noneoftheabove答案:E解析:

暂无解析14.单选题________isinvokedtocreateanobject.()(1分)A、AconstructorB、ThemainmethodC、AmethodwithareturntypeD、Amethodwiththevoidreturntype答案:A解析:

暂无解析15.单选题___________isattachedtotheclassofthecomposingclasstodenotetheaggregationrelationshipwiththecomposedobject.()(1分)A、AnemptydiamondB、AsoliddiamondC、AnemptyovalD、Asolidoval答案:A解析:

暂无解析16.单选题Fillinthecodetocompletethefollowingmethodforsortingalist.()

Publicstaticvoidsort(double[]list){

___________________________;

}

Publicstaticvoidsort(double[]list,inthigh){

If(high>1){

//Findthelargestnumberanditsindex

IntindexOfMax=0;

Doublemax=list[0];

For(inti=1;i<=high;i++){

If(list[i]>max){

Max=list[i];

IndexOfMax=i;

}

}

//Swapthelargestwiththelastnumberinthelist

List[indexOfMax]=list[high];

List[high]=max;

//Sorttheremaininglist

Sort(list,high-1);

}

}(1分)A、sort(list)B、sort(list,list.length)C、sort(list,list.length-1)D、sort(list,list.length-2)答案:C解析:

暂无解析17.单选题Whichofthefollowingiscorrecttosorttheelementsinalistlst?()(1分)A、lst.sort()B、Collections.sort(lst)C、Arrays.sort(lst)D、newLinkedList<String>(newString[]{"red","green","blue"})答案:B解析:

暂无解析18.单选题Analyzingalgorithmefficiencyis________.()(1分)A、tomeasuretheiractualexecutiontimeB、toestimatetheirexecutiontimeC、toestimatetheirgrowthfunction答案:C解析:

暂无解析19.单选题Whatis1+1+1+1+1==5?()(1分)A、trueB、falseC、Thereisnoguaranteethat1+1+1+1+1==5istrue.答案:A解析:

暂无解析20.单选题Theworst-timecomplexityforheapsortis_________()(1分)A、O(1)B、O(logn)C、O(n)D、O(nlogn)E、O(n*n)答案:D解析:

暂无解析21.单选题Thetimecomplexityfortheselectionsortalgorithminthetextis________.()(1分)A、O(nlogn)B、O(n^2)C、O(logn)D、O(2^n)答案:B解析:

暂无解析22.单选题Analyzethefollowingcode:()

PublicclassTest{

Publicstaticvoidmain(Stringargs[]){

NClassnc=newNClass();

Nc点t=nc点t++;

}

}

ClassNClass{

Intt;

PrivateNClass(){

}

}(1分)A、TheprogramhasacompileerrorbecausetheNClassclasshasaprivateconstructor.B、Theprogramdoesnotcompilebecausetheparameterlistofthemainmethodiswrong.C、Theprogramcompiles,buthasaruntimeerrorbecausethasnoinitialvalue.D、Theprogramcompilesandrunsfine.答案:A解析:

暂无解析23.单选题WhichofthedatatypesbelowcouldbeusedtostoreelementsintheirnaturalorderbasedonthecompareTomethod?()(1分)A、HashSetB、TreeSetC、LinkedHashSetD、CollectionE、Set答案:B解析:

暂无解析24.单选题SupposethexMethod()isinvokedfromamainmethodinaclassasfollows,xMethod()is_________intheclass.()

Publicstaticvoidmain(String[]args){

XMethod();

}(1分)A、astaticmethodB、aninstancemethodC、astaticmethodoraninstancemethod答案:A解析:

暂无解析25.单选题Whichofthefollowingstatementsispreferredtocreateastring"WelcometoJava"?()(1分)A、Strings="WelcometoJava";B、Strings=newString("WelcometoJava");C、Strings;s="WelcometoJava";D、Strings;s=newString("WelcometoJava");答案:A解析:

暂无解析26.单选题Analyzethefollowingcode.()

ClassTest{

Publicstaticvoidmain(String[]args){

Strings;

System.out.println("sis"+s);

}

}(1分)A、Theprogramhasacompileerrorbecausesisnotinitialized,butitisreferencedintheprintlnstatement.B、Theprogramhasaruntimeerrorbecausesisnotinitialized,butitisreferencedintheprintlnstatement.C、Theprogramhasaruntimeerrorbecausesisnullintheprintlnstatement.D、Theprogramcompilesandrunsfine.答案:A解析:

暂无解析27.单选题Whatistheoutputofthefollowingcode?()

ArrayList<Integer>list=newArrayList<>();

List.add(1);

List.add(2);

List.add(3);

List.remove(2);

System.out.println(list);(1分)A、[1,2,3]B、[1,2]C、[1]D、[1,3]E、[2,3]答案:B解析:

暂无解析28.单选题SupposeTestSimpleCircleandSimpleCircleinListing9.1areintwoseparatefilesnamedTestSimpleCircle.javaandSimpleCircle.java,respectively.WhatistheoutcomeofcompilingTestsimpleCircle.javaandthenSimpleCircle.java?()(1分)A、OnlyTestSimpleCircle.javacompiles.B、OnlySimpleCircle.javacompiles.C、Bothcompilefine.D、Neithercompilessuccessfully.答案:C解析:

暂无解析29.单选题Therelationshipbetweenaninterfaceandtheclassthatimplementsitis()(1分)A、CompositionB、AggregationC、InheritanceD、None答案:C解析:

暂无解析30.单选题Analyzethefollowingcode.Whichofthefollowingstatementsiscorrect?()

PublicclassTest{

Publicstaticvoidmain(String[]args){

Numberx=newInteger(3);

System.out.println(Value());

System.out.println((Integer)pareTo(newInteger(4)));

}

}(1分)A、TheprogramhasacompileerrorbecauseanIntegerinstancecannotbeassignedtoaNumbervariable.B、TheprogramhasacompileerrorbecauseintValueisanabstractmethodinNumber.C、TheprogramhasacompileerrorbecausexcannotbecastintoInteger.D、Theprogramhasacompileerrorbecausethememberaccessoperator(.)isexecutedbeforethecastingoperator.E、Theprogramcompilesandrunsfine.答案:D解析:

暂无解析31.单选题Analyzethefollowingcode.()

Importjava.util.*;

PublicclassTest{

Publicstaticvoidmain(String[]args)throwsException{

TreeSet<String>set=newTreeSet<>();

Set.add("Red");

Set.add("Yellow");

Set.add("Green");

Set.add("Blue");

SortedSettemp=set.headSet("Purple");

System.out.println(temp.first());

}

}(1分)A、TheprogramdisplaysRedB、TheprogramdisplaysBlueC、TheprogramdisplaysGreenD、TheprogramdisplaysYellowE、TheprogramdisplaysPurple答案:B解析:

暂无解析32.单选题ThetimecomplexityfortheTowersofHonoialgorithminthetextis________.()(1分)A、O(n)B、O(n^2)C、O(n^3)D、O(2^n)答案:D解析:

暂无解析33.单选题WhichofthefollowingdeclaresanabstractmethodinanabstractJavaclass?()(1分)A、publicabstractmethod();B、publicabstractvoidmethod();C、publicvoidabstractmethod();D、publicvoidmethod(){}E、publicabstractvoidmethod(){}答案:B解析:

暂无解析34.单选题ThetimecomplexityfortheSieveofEratosthenesalgorithmis________.()(1分)A、O(n)B、O(n^(1.5)/logn)C、O(logn)D、O(2^n)答案:B解析:

暂无解析35.单选题Whatistheoutputofthefollowingcode?()

Importjava.util.*;

PublicclassTest{

Publicstaticvoidmain(String[]args){

List<String>list1=newArrayList<>();

List1.add("Atlanta");

List1.add("Macon");

List1.add("Savanna");

List<String>list2=newArrayList<>();

List2.add("Atlanta");

List2.add("Macon");

List2.add("Savanna");

List<String>list3=newArrayList<>();

List3.add("Macon");

List3.add("Savanna");

List3.add("Atlanta");

System.out.println(list1.equals(list2)+""+list1.equals(list3));

}

}(1分)A、truetrueB、truefalseC、falsefalseD、falsetrue答案:B解析:

暂无解析36.单选题Whatislistafterthefollowingcodeisexecuted?()

ArrayList<Integer>list=newArrayList<>();

List.add(1);

List.add(2);

List.add(3);

List.add(4);

List.add(5);

List.remove(2);

System.out.println(list);(1分)A、[1,2,3,4,5]B、[2,3,4,5]C、[1,3,4,5]D、[1,2,4,5]E、[1,2,3,4]答案:D解析:

暂无解析37.单选题Whatisthenumberofiterationsinthefollowingloop:()

Intcount=5;

While(count<n){

Count=count+3;

}(1分)A、n-5B、n-3C、n/3-1D、(n-5)/3E、theceilingof(n-5)/3答案:E解析:

暂无解析38.TodeclareaclassnamedAwithagenerictype,use(1分)A、publicclassA<E>{...}B、publicclassA<E,F>{...}C、publicclassA<E,F>{...}D、publicclassA(E,F){...}答案:A解析:

暂无解析39.单选题__________representsanentityintherealworldthatcanbedistinctlyidentified.()(1分)A、AclassB、AnobjectC、AmethodD、Adatafield答案:B解析:

暂无解析40.单选题ThetimecomplexityfortheTowersofHonoialgorithminthetextis________.()(1分)A、O(n)B、O(n^2)C、O(n^3)D、O(2^n)答案:D解析:

暂无解析多选题(总共40题)1.多选题Whichofthefollowingstatementsaretrue?()(1分)A、Everyrecursivemethodmusthaveabasecaseorastoppingcondition.B、Everyrecursivecallreducestheoriginalproblem,bringingitincreasinglyclosertoabasecaseuntilitbecomesthatcase.C、Infiniterecursioncanoccurifrecursiondoesnotreducetheprobleminamannerthatallowsittoeventuallyconvergeintothebasecase.D、Everyrecursivemethodmusthaveareturnvalue.E、Arecursivemethodisinvokeddifferentlyfromanon-recursivemethod.答案:ABC解析:

暂无解析2.多选题Giventhefollowingcode,findthecompileerror.()

PublicclassTest{

Publicstaticvoidmain(String[]args){

M(newGraduateStudent());

M(newStudent());

M(newPerson());

M(newObject());

}

Publicstaticvoidm(Studentx){

System.out.println(x.toString());

}

}

ClassGraduateStudentextendsStudent{

}

ClassStudentextendsPerson{

@Override

PublicStringtoString(){

Return"Student";

}

}

ClassPersonextendsObject{

@Override

PublicStringtoString(){

Return"Person";

}

}(1分)A、m(newGraduateStudent())causesanerrorB、m(newStudent())causesanerrorC、m(newPerson())causesanerrorD、m(newObject())causesanerror答案:CD解析:

暂无解析3.多选题SupposeArrayListxcontainstwostrings[Beijing,Singapore].Whichofthefollowingmethodwillcauseruntimeerrors?()(1分)A、x.get(1)B、x.set(2,"NewYork");C、x.get(2)D、x.remove(2)E、x.size()答案:BCD解析:

暂无解析4.多选题SupposeAisanabstractclass,Bisaconcretesubclassof

A,andbothAandBhaveano-argconstructor.Whichofthefollowingiscorrect?()(1分)A、Aa=newA();B、Aa=newB();C、Bb=newA();D、Bb=newB();答案:BD解析:

暂无解析5.多选题Whichofthefollowingstatementsaretrue?()(1分)A、AnArrayListcangrowautomatically.B、AnArrayListcanshrinkautomatically.C、YoucanreducethecapacityofanArrayListbyinvokingthetrimToSize()methodonthelist.D、YoucanreducethecapacityofaLinkedListbyinvokingthetrimToSize()methodonthelist.答案:AC解析:

暂无解析6.多选题SupposeArrayListxcontainsthreestrings[Beijing,Singapore,Tokyo].Whichofthefollowingmethodswillcauseruntimeerrors?()(1分)A、x.get(2)B、x.set(3,"NewYork");C、x.get(3)D、x.remove(3)E、x.size()答案:BCD解析:

暂无解析7.多选题Whichofthefollowingstatementsaretrue?()(1分)A、Generictypeinformationispresentatcompiletime.B、Generictypeinformationisnotpresentatruntime.C、Youcannotcreateaninstanceusingagenericclasstypeparameter.D、Youcannotcreateanarrayusingagenericclasstypeparameter.E、Youcannotcreateanarrayusingagenericclass.答案:ABCDE解析:

暂无解析8.多选题WhichofthefollowingmethodsareintheCollectioninterface?()(1分)A、remove(o:Object):booleanB、removeAll(c:Collection<?>):booleanC、delete(o:D、:booleanE、deleteAll(c:Collection<?>):boolean答案:AB解析:

暂无解析9.多选题Whichofthefollowingstatementsiscorrect?()(1分)A、Comparable<String>c=newString("abc");B、Comparable<String>c="abc";C、Comparable<String>c=newDate();D、Comparable<Object>c=newDate();答案:AB解析:

暂无解析10.多选题Giventhefollowingcode,findthecompileerror.()

PublicclassTest{

Publicstaticvoidmain(String[]args){

M(newGraduateStudent());

M(newStudent());

M(newPerson());

M(newObject());

}

Publicstaticvoidm(Studentx){

System.out.println(x.toString());

}

}

ClassGraduateStudentextendsStudent{

}

ClassStudentextendsPerson{

@Override

PublicStringtoString(){

Return"Student";

}

}

ClassPersonextendsObject{

@Override

PublicStringtoString(){

Return"Person";

}

}(1分)A、m(newGraduateStudent())causesanerrorB、m(newStudent())causesanerrorC、m(newPerson())causesanerrorD、m(newObject())causesanerror答案:CD解析:

暂无解析11.多选题SupposeListlist=newArrayList().Whichofthefollowingoperationsarecorrect?()(1分)A、list.add("Red");B、list.add(newInteger(100));C、list.add(newjava.util.Date());D、list.add(newArrayList());答案:ABCD解析:

暂无解析12.多选题WhenyoucreateanArrayListusingArrayList<String>x=newArrayList<>(2),________()(1分)A、twoelementsarecreatedinthearraylist.B、noelementsarecurrentlyinthearraylist.C、thearraylistsizeiscurrently2.D、thearraylistcapacityiscurrently2.答案:BD解析:

暂无解析13.多选题WhichofthefollowingcanbeusedtoreplaceYYYYYYYYinthefollowingcode?()

PublicclassWildCardDemo3{

Publicstaticvoidmain(String[]args){

GenericStack<String>stack1=newGenericStack<>();

GenericStack<Object>stack2=newGenericStack<>();

Stack2.push("Java");

Stack2.push(2);

Stack1.push("Sun");

Add(stack1,stack2);

WildCardDemo2.print(stack2);

}

Publicstatic<T>voidYYYYYYYY{

While(!stack1.isEmpty())

Stack2.push(stack1.pop());

}

}(1分)A、add(GenericStack<T>stack1,GenericStack<T>stack2)B、add(GenericStack<?extendsT>stack1,GenericStack<T>stack2)C、add(GenericStack<T>stack1,GenericStack<?superT>stack2)D、add(GenericStack<T>stack1,GenericStack<Object>stack2)答案:BC解析:

暂无解析14.多选题Whichofthefollowingstatementsistrue?()(1分)A、Youcanalwayspassaninstanceofasubclasstoaparameterofitssuperclasstype.Thisfeatureisknownaspolymorphism.B、Thecompilerfindsamatchingmethodaccordingtoparametertype,numberofparameters,andorderoftheparametersatcompiletime.C、Amethodmaybeimplementedinseveralsubclasses.TheJavaVirtualMachinedynamicallybindstheimplementationofthemethodatruntime.D、Dynamicbindingcanapplytostaticmethods.E、Dynamicbindingcanapplytoinstancemethods.答案:ABCE解析:

暂无解析15.多选题SupposeArrayList<Double>list=newArrayList<>().Whichofthefollowingstatementsarecorrect?()(1分)A、list.add(5.5);//5.5isautomaticallyconvertedtonewDouble(5.5)B、list.add(3.0);//3.0isautomaticallyconvertedtonewDouble(3.0)C、DoubledoubleObject=list.get(0);//NocastingisneededD、doubled=list.get(1);//Automaticallyconvertedtodouble答案:ABCD解析:

暂无解析16.多选题WhichofthefollowingcanbeusedtoreplaceYYYYYYYYinthefollowingcode?()

PublicclassWildCardDemo3{

Publicstaticvoidmain(String[]args){

GenericStack<String>stack1=newGenericStack<>();

GenericStack<Object>stack2=newGenericStack<>();

Stack2.push("Java");

Stack2.push(2);

Stack1.push("Sun");

Add(stack1,stack2);

WildCardDemo2.print(stack2);

}

Publicstatic<T>voidYYYYYYYY{

While(!stack1.isEmpty())

Stack2.push(stack1.pop());

}

}(1分)A、add(GenericStack<T>stack1,GenericStack<T>stack2)B、add(GenericStack<?extendsT>stack1,GenericStack<T>stack2)C、add(GenericStack<T>stack1,GenericStack<?superT>stack2)D、add(GenericStack<T>stack1,GenericStack<Object>stack2)答案:BC解析:

暂无解析17.多选题Supposes1ands2aretwostrings.Whichofthefollowingstatementsorexpressionsareincorrect?()(1分)A、Strings=newString("newstring");B、Strings3=s1+s2C、s1>=s2D、inti=s1.lengthE、s1.charAt(0)='5'答案:CDE解析:

暂无解析18.多选题Whichofthefollowingstatementsiscorrect?()(1分)A、Genericscanhelpdetecttypeerrorsatcompiletime,thusmakeprogramsmorerobust.B、Genericscanmakeprogramseasytoread.C、Genericscanavoidcumbersomecastings.D、Genericscanmakeprogramsrunfaster.答案:ABC解析:

暂无解析19.多选题WhichofthefollowingisapossibleoutputfrominvokingMath.random()?()(1分)A、3.43B、0.5C、0.0D、1.0答案:BC解析:

暂无解析20.多选题Whichofthefollowingstatementswillconvertastringsintoiofinttype?()(1分)A、i=Integer.parseInt(s);B、i=(newInteger(s)).intValue();C、i=Integer.valueOf(s).intValue();D、i=Integer.valueOf(s);E、i=(int)(Double)parseDouble(s));答案:ABCDE解析:

暂无解析21.多选题java.util.Stackisasubclassof__________.()(1分)A、java.util.ArrayListB、java.util.LinkedListC、java.util.AbstractListD、java.util.VectorE、java.util.List答案:CDE解析:

暂无解析22.多选题Tocheckifastringscontainstheprefix"Java",youmaywrite()(1分)A、if(s.startsWith("Java"))...B、if(s.indexOf("Java")==0)...C、if(s.substring(0,4).equals("Java"))...D、if(s.charAt(0)=='J'&&s.charAt(1)=='a'&&s.charAt(2)=='v'&&s.charAt(3)=='a')...答案:ABCD解析:

暂无解析23.多选题Whichofthefollowingstatementsaretrue?()(1分)A、java.util.Listinheritsallthemethodsfromjava.util.Collection.Additionally,itcontainsnewmethodsformanipulatingalist.B、TheAbstractListclassprovidesapartialimplementationfortheListinterface.C、ArrayListisaconcreteimplementationofListusinganarray.D、LinkedListisaconcreteimplementationofListusingalinkedlist.LinkedListcontainsallthemethodsinListandadditionalnewmethodsformanipulatingalinkedlist.E、ListIteratorisasubinterfaceofIteratoranditprovidesthemethodstosupportbi-directionaltraversalofalist.答案:ABCDE解析:

暂无解析24.多选题FillinthecodetocompletethefollowingmethodforcomputingaFibonaccinumber.()

Publicstaticlongfib(longindex){

If(index==0)//Basecase

Return0;

Elseif(index==1)//Basecase

Return1;

Else//Reductionandrecursivecalls

Return__________________;

}(1分)A、fib(index-1)B、fib(index-2)C、fib(index-1)+fib(index-2)D、fib(index-2)+fib(index-1)答案:CD解析:

暂无解析25.多选题TheCollectioninterfaceisthebaseinterfacefor_____________.()(1分)A、SetB、ListC、ArrayListD、LinkedListE、Map答案:ABCD解析:

暂无解析26.多选题Analyzethefollowingcode:()

Importjava.util.*;

PublicclassTest{

Publicstaticvoidmain(String[]args){

HashSet<String>set1=newHashSet<>();

Set1.add("red");

Set<String>set2=set1.clone();

}

}(1分)A、Line5iswrongbecauseaHashSetobjectcannotbecloned.B、Line5hasacompileerrorbecauseset1.clone()returnsanObject.YouhavetocastittoSetinordertocompileit.C、Theprogramwillbefineifset1.clone()isreplacedby(Set<String>)set1.clone()D、Theprogramwillbefineifset1.clone()isreplacedby(Set<String>)(set1.clone())E、Theprogramwillbefineifset1.clone()isreplacedby(HashSet<String>)(set1.clone())答案:BDE解析:

暂无解析27.多选题Whichofthefollowingareincorrect?()(1分)A、Anabstractclasscontainsconstructors.B、Theconstructorsinanabstractclassshouldbeprotected.C、Theconstructorsinanabstractclassareprivate.D、Youmaydeclareafinalabstractclass.E、Aninterfacemaycontainconstructors.答案:CDE解析:

暂无解析28.多选题Whichofthefollowingdatatypeshaveiterators?()(1分)A、HashSetB、TreeSetC、ArrayListD、LinkedListE、LinkedHashSet答案:ABCDE解析:

暂无解析29.多选题Theelementsin________aresorted.()(1分)A、TreeSetB、ListC、TreeMapD、HashSetE、LinkedHashSet答案:AC解析:

暂无解析30.Whichofthefollowingstatementsregardingabstractmethodsistrue?()(1分)A、Abstractclasseshaveconstructors.B、Aclassthatcontainsabstractmethodsmustbeabstract.C、Itispossibletodeclareanabstractclassthatcontainsnoabstractmethods.D、Anabstractmethodcannotbecontainedinanonabstractclass.E、Adatafieldcanbedeclaredabstract.答案:ABCD解析:

暂无解析31.多选题Whichofthefollowingis/arecorrect?()(1分)A、Aconstructormaybestatic.B、Aconstructormaybeprivate.C、Aconstructormayinvokeastaticmethod.D、Aconstructormayinvokeanoverloadedconstructor.E、Aconstructorinvokesitssuperclassno-argconstructorbydefaultifaconstructordoesnotinvokeanoverloadedconstructororitssuperclassconstructor.答案:BCDE解析:

暂无解析32.多选题Whichofthefollowingdatatypeshaveiterators?()(1分)A、HashSetB、TreeSetC、ArrayListD、LinkedListE、LinkedHashSet答案:ABCDE解析:

暂无解析33.多选题Analyzethefollowingcode:()

ClassTest{

Privatedoublei;

PublicTest(do

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论