A: 无法编译
B: foo的值是true
C: foo的值是false
D: foo的值是0
举一反三
- Given: int index = 1; boolean[] test = new Boolean; boolean foo= test [index]; What is the result?
- test = new Boolean; boolean foo= test [index]; What is the result?
- 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.
- 以下代码片段的输出结果为( ). [script type="text/javascript"] var foo =1; function Test(){ alert(foo); var foo=2; alert(foo); } Test(); </script A: 1,2 B: 2,1 C: 1,undefined D: undefined,2
- 以下代码片段的输出结果为( ). [script type="text/javascript"] var foo =1; function Test(){ alert(foo); var foo=2; alert(foo); } test(); </script A: 1,2 B: 2,1 C: undefined,2 D: 没有任何结果
内容
- 0
下面程序段的运行结果为() int index=1; int[] foo=new int[3]; int bar=foo[index]; int baz= bar+index;
- 1
读代码: public class Test { public static void main (String args[]) { class Foo { public int i = 3; } Object o = (Object) new Foo(); Foo foo = (Foo)o; System.out.println(foo.i); } } 结果是:
- 2
关于以下初始化序列的执行结果的说法正确的是( )。 int index=1; int[] foo=new int[3]; int bar=foo[index]; int baz=bar+index; A: baz的值为0 B: baz的值为1 C: 编译通过,但产生异常 D: 编译不能通过
- 3
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.
- 4
对于 boolean b[]=new boolean[3]; 下列哪个叙述是正确的?