importjava.util.*;2.3.ClassFindStuff{4.publicstaticvoidmain(String[]args){5.//insertcodehere6.c.put(x,123);7.}8.}分别插入到第5行,哪三行允许代码编译?() A.Mapc=newSortedMap();B.HashMapc=newHashMap();C.HashMapc=newHashtable();D.SortedMapc=newTreeMap();
importjava.util.*;2.3.ClassFindStuff{4.publicstaticvoidmain(String[]args){5.//insertcodehere6.c.put("x",123);7.}8.}分别插入到第5行,哪三行允许代码编译?()
A.Mapc=newSortedMap();
B.HashMapc=newHashMap();
C.HashMapc=newHashtable();
D.SortedMapc=newTreeMap();
相关考题:
classCalc{2.publicstaticvoidmain(String[]args){3.try{4.intx=Integer.parseInt(42a);5.//insertcodehere6.System.out.print(oops);7.}8.}9.}下面哪两行分别插入到第五行,会导致输出oops”?() A.}catch(ClassCastExceptionc){B.}catch(IllegalStateExceptionc){C.}catch(NumberFormatExceptionn){D.}catch(IllegalArgumentExceptione){
classHorseRadish{2.//insertcodehere3.protectedHorseRadish(intx){4.System.out.println(bokchoy);5.}6.}7.classWasabiextendsHorseRadish{8.publicstaticvoidmain(String[]args){9.Wasabiw=newWasabi();10.}11.}分别插入到第2行,哪两项允许代码编译并产生bokchoy输出结果?()A.//justacommentB.protectedHorseRadish(){}C.protectedHorseRadish(){this(42);}D.protectedHorseRadish(){newHorseRadish(42);}
1.classPasser2{2.//insertcodehere3.staticintbigState=42;4.publicstaticvoidmain(String[]args){5.bigState=p2.go(bigState);6.System.out.print(bigState);7.}8.intgo(intx){9.return++x;10.}11.}和4段代码片段:staticPasser2p2=newPasser2();finalstaticPasser2p2=newPasser2();privatestaticPasser2p2=newPasser2();finalprivatestaticPasser2p2=newPasser2();有多少行分别插入到第2行,可以编译?()A.0B.1C.3D.4
现有:1.classBook{2.book);}3.}4.classPageextendsBook{5.publicstaticvoidmain(String[]args){6.//insertcodehere7.}8.privatefinalvoidread(){System.out.print(page);}9.}和如下三个代码片段(x,y,z):x.//justacommenty.newPage().read();z.newBook().read();分别插入到第6行,有几个允许代码通过编译并可以运行且无异常?()
现有:1.classHorseRadish{2.//insertcodehere3.protectedHorseRadish(intx){4.System.out.println(bokchoy);5.}6.}7.classWasabiextendsHorseRadish{8.publicstaticvoidmain(String[]args){9.Wasabiw=newWasabi();10.}11.}分别插入到第2行,哪两项允许代码编译并产生bokchoy输出结果?()A.//justacommentB.protectedHorseRadish(){}C.protectedHorseRadish(){this(42);}D.protectedHorseRadish(){newHorseRadish(42);}
现有:1.importjava.util.*;2.3.ClassFindStuff{4.publicstaticvoidmain(String[]args){5,//insertcodehere6.c.put(X,123);7.}8.}分别插入到第5行,哪三行允许代码编译?() A.Mapc=newSortedMap();B.HashMapc=newHashMap();C.HashMapc=newHashtalole();D.SortedMapc=newTreeMap();E.ArrayListc=newArrayList();F.MaDc=newLinkedHashMap();
现有:importjava.util.*;classScanStuff{publicstaticvoidmain(String[]args){StringS=x,yy,123;Scannersc=newScanner(s);while(sc.hasNext())System.out.print(sc.next()+);}}结果是什么?() A.xyyB.x,yy,123C.xyy123D.x,yyE.编译失败F.运行的时候有异常抛出
现有1.classCalc{2.publicstaticvoidmain(String[]args){3.try{4.intx=Integer.parselnt(42a);5.//insertcodehere6.System.out.print(oops);7.}8.}9.}下面哪两行分别插入到第五行,会导致输oops?() A.}catch(IllegalArgumentExceptione){B.}catch(IllegalStateExceptionc){C.}catch(NumbelFormatExceptionn){D.}catch(ClassCastExceptionc){
现有:classHorseRadish{//insertcodehereprotectedHorseRadish(intx){System.out.println(bokchoy);}}classWasabiextendsHorseRadish{publicstaticvoidmain(String[]args){Wasabiw-newWasabi();}}分别插入到第2行,哪两项允许代码编译并产生”bokchoy”输出结果()A.protectedHorseRadish(){this(42);}B.protectedHorseRadish(){}C.//justacommentD.protectedHorseRadish(){newHorseRadish(42);}