A.99722
B.955758
C.4510758
D.459722
第1题:
现有
classParserextendsUtils{
publicstaticvoidmain(String[]args){
try{System.out.print(newParser().getlnt("42"))
}catch(Exceptione){
System.out.println("Exc");}
}
intgetlnt(Stringarg)throwsException{
returnInteger.parselnt(arg);
}
}
classUtils{
intgetlnt(){return42;}
}
结果是什么?()
第2题:
现有:classFlow{publicstaticvoidmain(String[]args)try{System.out.print("before");doRiskyThing();System.out.print("after");}catch(Exceptionfe){System.out.print("catch");}System.out.println("done");}publicstaticvoiddoRiskyThing()throwsException{//thiscodereturnsunlessitthrowsanException}}可能会产生哪两项结果?()
A.beforecatch
B.beforeafterdone
C.beforecatchdone
D.beforeaftercatch
第3题:
A.55
B.56
C.65
D.66
第4题:
现有:classBirds{publicstaticvoidmain(String[]args){try{thrownewException();}catch(Exceptione){try{thrownewException();}catch(Exceptione2){System.out.print("inner");}System.out.print("middle");}System.out.print("outer");}}结果是()
A.innerouter
B.middleouter
C.innermiddleouter
D..编译失败
第5题:
现有:classCat{Cat(intc){System.out.print{"cat"+c+"");}}classSubCatextendsCat{SubCat(intc){super(5);System.out.print("cable");}SubCat(){this(4);}publicstaticvoidmain(String[]args){SubCats=newSubCat();}}结果为:()
A.cat5
B.cable
C.cat5cable
D.cablecat5