以下程序代码执行后,哪个说法正确?int index = 1;boolean[] test =new Boolean[3];boolean foo=test [index];
A: 无法编译
B: foo的值是true
C: foo的值是false
D: foo的值是0
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: 没有任何结果