A.Bazhasthevalueof0
B.Bazhasthevalueof1
C.Bazhasthevalueof2
D.Anexceptionisthrown.
E.Thecodewillnotcompile.
第1题:
A.Compilationwillfail.
B.Compilationwillsucceedandtheprogramwillprint“3”
C.CompilationwillsucceedbuttheprogramwillthrowaClassCastExceptionatline6.
D.CompilationwillsucceedbuttheprogramwillthrowaClassCastExceptionatline7.
第2题:
下面程序执行后,baz的值应是______。 public class Test9 { public static void main(String[] args) { int index = 1; int fox[] = new int [3]; iht bar = fox [index]; int baz = bar + index; System.out.println(baz); } }
A.0
B.1
C.2
D.编译错误
第3题:
下列程序执行后,baz的值应是 int index=1; int fox[ ]=new int[3]; Int bar=fox[index]; int baz:bar+index;
A.0
B.1
C.2
D.编译错误
第4题:
A.Bazhasthevalueof0
B.Bazhasthevalueof1
C.Bazhasthevalueof2
D.Anexceptionisthrown.
E.Thecodewillnotcompile.
第5题:
关于以下初始化序列的执行结果的说法正确的是( )。 int index=1; int[] foo=new int[3]; int bar=foo[index]; int baz=bar+index;
A.baz的值为0
B.baz的值为1
C.编译通过,但产生异常
D.编译不能通过