A.Compilationfails.
B.Compilationsucceedswitherrors.
C.Compilationsucceedswithwarnings.
D.Compilationsucceedswithoutwarningsorerrors.
第1题:
A.true
B.false
C.Compilationfails.
D.Anexceptionisthrownatruntime.
第2题:
A.finished
B.Compilationfails.
C.AnAssertionErroristhrown.
D.AnAssertionErroristhrownandfinishedisoutput.
Thisquestionisabittrickybecauseitlacksthefollowinginformation:Itshouldincludeastatementthatsayswhetherornotassertionsareenabled.Iftheyareindeedenabled,the
correctionanswerisC.butiftheyarenot,thecorrectanswerisA.Assertionsarenotenabledbydefaultsoifthequestionisnotchanged,themostlogicalanswerisA.
第3题:
2、1、写出以下程序的输出内容。 public class Test { public static void changeValue(int value){ value = 0; } public static void main(String[] args) { int value = 2010; changeValue(value); System.out.println(value); } }
第4题:
A.finished
B.Compilationfails.
C.AnAssertionErroristhrownandfinishedisoutput.
D.AnAssertionErroristhrownwiththemessage“assertionfailed”.
E.AnAssertionErroristhrownwiththemessage“assertionpassed”.
第5题:
执行下列程序段之后,变量b的值为( )。 public class Test { public static void main (String[] args) { int i = 12; int j = 24; boolean b1 = true; booleanb=(j%i==0)&&(! b1) || (j/i! =2); System. out. println (B); } }
A.true
B.false
C.0
D.1