Baz has the value of 0
Baz has the value of 1
Baz has the value of 2
An exception is thrown.
The code will not compile.
第1题:
下面程序执行后,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.编译错误
第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题:
A.Bazhasthevalueof0
B.Bazhasthevalueof1
C.Bazhasthevalueof2
D.Anexceptionisthrown.
E.Thecodewillnotcompile.
第4题:
Which statements concerning the relationships between the following classes are true?() class Foo { int num; Baz comp = new Baz(); } class Bar { boolean flag; } class Baz extends Foo { Bar thing = new Bar(); double limit; }
第5题:
int index = 1; String test = new String; String foo = test[index]; What is the result?()
第6题:
写出结果
void foo(int p1[])
{
*p1 += 5;
}
void bar(int p2[])
{
p2[1] = 15;
}
void main()
{
int a[]={3,4,5};
int b[]={3,4,5};
int *p2;
p2=&a[1];
bar(p2);
printf("%i %i %i\n",a[0],a[1],a[2]);
p2=&b[0];
p2++;
foo(p2);
bar(p2);
printf("%i %i %i\n",b[0],b[1],b[2]);
}
第7题:
下列程序执行后,baz的值应是 int index=1; int fox[ ]=new int[3]; Int bar=fox[index]; int baz:bar+index;
A.0
B.1
C.2
D.编译错误
第8题:
A.Foo { public int bar() { return 1; }
B.new Foo { public int bar() { return 1; }
C.new Foo() { public int bar() { return 1; }
D.new class Foo { public int bar() { return 1; }
第9题:
Which code determines the int value foo closest to a double value bar?()
第10题:
1. class SuperFoo { 2. SuperFoo doStuff(int x) { 3. return new SuperFoo(); 4. } 5. } 6. 7. class Foo extends SuperFoo { 8. //insert code here 9. } 下面哪三项分别插入到第8行,可以编译?()