下面程序段的运行结果为() int index=1; int[] foo=new int[3]; int bar=foo[index]; int baz= bar+index;
举一反三
- int index = 1; int [] foo = new int [3]; int bar = foo [index]; int baz = bar + index; What is the result?() A: Baz has the value of 0 B: Baz has the value of 1 C: Baz has the value of 2 D: An exception is thrown. E: The code will not compile.
- 下列程序段的运行结果为( )int index = 1;int foo[] = new int[3];int bar = foo[index];int baz = bar + index; A: baz 的值为 0 B: baz 的值为 1 C: baz 的值为 2 D: 抛出一个异常
- 关于以下初始化序列的执行结果的说法正确的是( )。 int index=1; int[] foo=new int[3]; int bar=foo[index]; int baz=bar+index; A: baz的值为0 B: baz的值为1 C: 编译通过,但产生异常 D: 编译不能通过
- 下列程序执行后,baz的值应是( )。 int index=1; int fox[ ]=new int[3]; Int bar=fox[index]; int baz:bar+index; A: 8,6,4,1 B: 8,6,3,2 C: 8,8,4,1 D: 8,6,4,2
- int index = 1; int foo = new int ; int bar = foo [index]; int baz = bar + index; What is the result?() A: Baz has the value of 0 B: Baz has the value of 1 C: Baz has the value of 2 D: An exception is thrown. E: The code will not compile.