5 out of 30
7 out of 30
18 out of 30
23 out of 30
第1题:
A.99722
B.955758
C.4510758
D.459722
第2题:
staticvoidtest()throwsRuntimeException{try{System.out.print(”test);thrownewRuntimeException();}catch(Exceptionex){System.out.print(”exception);}}publicstaticvoidmain(String[]args){try{test();}catch(RuntimeExceptionex){System.out.print(”runtime);}System.out.print(”end);}Whatistheresult?()
A.testend
B.Compilationfails.
C.testruntimeend
D.testexceptionend
E.AThrowableisthrownbymainatruntime.
第3题:
publicclassX{publicstaticvoidmain(String[]args){try{badMethod();System.out.print(A”);}catch(Exceptionex){System.out.print(B”);}finally{System.out.print(C”);}System.out.print(D”);}publicstaticvoidbadMethod(){thrownewRuntimeException();}}Whatistheresult?()
A.AB
B.BC
C.ABC
D.BCD
E.Compilationfails.
第4题:
编译和执行以下代码,输出结果是( )。 int i=1; switch (i) { case 0: System.out.print("zero,"); break; case 1: System.out.print("one,"); case 2: System.out.print("two,"); default: System.out.println("default"); }
A.one,
B.one,two,
C.one,two,default
D.default
第5题:
class One { public One() { System.out.print(1); } } class Two extends One { public Two() { System.out.print(2); } } class Three extends Two { public Three() { System.out.print(3); } } public class Numbers{ public static void main( String[] argv) { new Three(); } } What is the result when this code is executed?()
第6题:
public class X { public static void main(String [] args) { try { badMethod(); System.out.print(“A”); } catch (Exception ex) { System.out.print(“B”); } finally { System.out.print(“C”); } System.out.print(“D”); } public static void badMethod() {} } What is the result?()
第7题:
现有: class Output { public static void main (String[] args) { int i=5: System.out.print( "4"+i+""); System.out.print (i+5+"7"); System.out.println (i+"8"); } } 结果为:()
第8题:
BD
BCD
BDE
BCDE
ABCDE
Compilation fails.
第9题:
1
3
123
321
The code rims with no output.
第10题:
IfA≠BThenSystem.out.print(A不等于B);
If(A≠B)System.out.print(A不等于B);
If(A!=B)ThenSystem.out.print(A不等于B);
IfA!=BThenSystem.out.printf(A不等于B);
第11题:
Researchers Have Pointed Out the Disadvantages of Breast-feeding
Researchers Have Found Out the Shortcomings of Formula
Breast-feeding Improves Chances of Success
Breast-feeding Benefits Both Mother and Baby
第12题:
5 out of 30
7 out of 30
18 out of 30
23 out of 30
第13题:
publicclassBase{publicstaticfinalStringFOO=foo”;publicstaticvoidmain(String[]args){Baseb=newBase();Subs=newSub();System.out.print(Base.FOO);System.out.print(Sub.FOO);System.out.print(b.FOO);System.out.print(s.FOO);System.out.print(((Base)s).FOO);}}classSubextendsBase{publicstaticfinalStringFOO=bar;}Whatistheresult?()
A.foofoofoofoofoo
B.foobarfoobarbar
C.foobarfoofoofoo
D.foobarfoobarfoo
E.barbarbarbarbar
F.foofoofoobarbar
G.foofoofoobarfoo
第14题:
publicclassX{publicstaticvoidmain(String[]args){try{badMethod();System.out.print(A”);}catch(RuntimeExceptionex){System.out.print(B”);}catch(Exceptionex1){System.out.print(C”);}finally{System.out.print(D”);}System.out.print(E”);}publicstaticvoidbadMethod(){thrownewRuntimeException();}}Whatistheresult?()
A.BD
B.BCD
C.BDE
D.BCDE
E.ABCDE
F.Compilationfails.
第15题:
publicclassX{publicstaticvoidmain(String[]args){try{badMethod();System.out.print(A”);}catch(Exceptionex){System.out.print(B”);}finally{System.out.print(C”);}System.out.print(D”);}publicstaticvoidbadMethod(){}}Whatistheresult?()
A.AC
B.BD
C.ACD
D.ABCD
E.Compilationfails.
第16题:
A.333
B.334
C.234
D.233
第17题:
public class Pet{ private String name; public Pet(){ System.out.print(1); } public Pet(String name){ System.out.print(2); } } public class Dog extends Pet{ public Dog(){ System.out.print(4); } public Dog(String name){ super(name); System.out.print(3); } } 执行new Dog(“棕熊”);后程序输出是哪项?()
第18题:
public class X { public static void main(String [] args) { try { badMethod(); System.out.print(“A”); } catch (RuntimeException ex) { System.out.print(“B”); } catch (Exception ex1) { System.out.print(“C”); } finally { System.out.print(“D”); } System.out.print(“E”); } public static void badMethod() { throw new RuntimeException(); } } What is the result?()
第19题:
33
13
23
123
第20题:
Computer Newspapers Are Well Liked
Newspapers of the Future Will Likely Be on Computer
Newspapers Are out of Fashion
New Communication Technology
第21题:
AB
BC
ABC
BCD
Compilation fails.
第22题:
AC
BD
ACD
ABCD
Compilation fails.
第23题:
99722
955758
4510758
459722