A.代码通过编译
B.由于第1行的错误导致编译失败
C.由于笫3行的错误导致编译失败
D.由于第6行的错误导致编译失败
第1题:
现有:voidtopGo(){try{middleGo();}catch(Exceptione){System.out.print("catch");}}voidmiddleGo()throwsException{go();system.out.print("latemiddle");}voidgo()throwsExceptiOn{thrownewException();}如果调用topGo(),则结果为:()
A.latemiddle
B.catch
C.latemiddlecatch
D.catchIatemiddle
第2题:
A.7
B.5
C.3
D.2
第3题:
A.privatesynchronizedObjecto;
B.voidgo(){synchronized(){/*codehere*/}}
C.publicsynchronizedvoidgo(){/*codehere*/}
D.privatesynchronized(this)voidgo(){/*codehere*/}
E.voidgo(){synchronized(Object.class){/*codehere*/}}
F.voidgo(){Objecto=newObject();synchronized(o){/*codehere*/}}
第4题:
现有:
classTree{
privatestaticStringtree="tree";
StringgetTree(){returntree;}
}
classElmextendsTree{
privatestaticStringtree="elm";
publicstaticvoidmain(String[]args){
newElm().go(newTree());
}
}
voidgo(Treet){
Strings=t.getTree()+Elm.tree+tree+(newElm().getTree());
System.out.println(s);}
结果为:()
第5题:
A.55
B.56
C.65
D.66