网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
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.
参考答案
参考解析
解析:
暂无解析
更多 “单选题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 0B Baz has the value of 1C Baz has the value of 2D An exception is thrown.E The code will not compile.” 相关考题
考题
intindex=1;int[]foo=newint[3];intbar=foo[index];intbaz=bar+index;Whatistheresult?()
A.Bazhasthevalueof0B.Bazhasthevalueof1C.Bazhasthevalueof2D.Anexceptionisthrown.E.Thecodewillnotcompile.
考题
Given:Which code, inserted at line 15, allows the class Sprite to compile?()
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; }
考题
下面程序执行后,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.0B.1C.2D.编译错误
考题
写出结果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]);}
考题
关于以下初始化序列的执行结果的说法正确的是( )。 int index=1; int[] foo=new int[3]; int bar=foo[index]; int baz=bar+index;A.baz的值为0B.baz的值为1C.编译通过,但产生异常D.编译不能通过
考题
下列程序执行后,baz的值应是 int index=1; int fox[ ]=new int[3]; Int bar=fox[index]; int baz:bar+index;A.0B.1C.2D.编译错误
考题
int index = 1; String test = new String; String foo = test[index]; What is the result?()A、 Foo has the value “”B、 Foo has the value nullC、 An exception is thrownD、 The code will not compile
考题
Which code determines the int value foo closest to a double value bar?() A、 Int foo = (int) Math.max(bar);B、 Int foo = (int) Math.min(bar);C、 Int foo = (int) Math.abs(bar);D、 Int foo = (int) Math.ceil(bar);E、 Int foo = (int) Math.floor(bar);F、 Int foo = (int) Math.round(bar);
考题
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; } A、A Bar is a Baz.B、A Foo has a Bar.C、A Baz is a Foo.D、A Foo is a Baz.E、A Baz has a Bar.
考题
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行,可以编译?()A、int doStuff() { return 42; }B、int doStuff(int x) { return 42; }C、Foo doStuff(int x) { return new Foo(); }D、SuperFoo doStuff(int x) { return new Foo(); }
考题
int index = 1; boolean test = new Boolean; boolean foo= test [index]; What is the result?()A、 Foo has the value of 0.B、 Foo has the value of null.C、 Foo has the value of true.D、 Foo has the value of false.E、 An exception is thrown.F、 The code will not compile.
考题
Given: 8.int index = 1: 9.Boolean [] test = new boolcan [3]; 10.boolcan foo = test [index]; What is the result()? A、 foo has the value of 0.B、 foo has the value of null.C、 foo has the value of true.D、 foo has the value of false.E、 An-exception is thrown.F、 The code will not compile.
考题
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 0B、 Baz has the value of 1C、 Baz has the value of 2D、 An exception is thrown.E、 The code will not compile.
考题
int index = 1; String [] test = new String[3]; String foo = test[index]; What is the result?() A、 Foo has the value “”B、 Foo has the value nullC、 An exception is thrownD、 The code will not compile
考题
public class Foo { public int a; public Foo() { a = 3; } public void addFive() { a += 5; } } and: public class Bar extends Foo { public int a; public Bar() { a = 8; } public void addFive() { this.a +=5; } } invoked with: Foo foo = new Bar(); foo.addFive(); System.out.println(”Value: “+ foo.a); What is the result?() A、 Value: 3B、 Value: 8C、 Value: 13D、 Compilation fails.E、 The code runs with no output.F、 An exception is thrown at runtime.
考题
单选题int index = 1; boolean[] test = new Boolean[3]; boolean foo= test [index]; What is the result?()A
Foo has the value of 0.B
Foo has the value of null.C
Foo has the value of true.D
Foo has the value of false.E
An exception is thrown.F
The code will not compile.
考题
单选题public class Foo { public int a; public Foo() { a = 3; } public void addFive() { a += 5; } } and: public class Bar extends Foo { public int a; public Bar() { a = 8; } public void addFive() { this.a +=5; } } invoked with: Foo foo = new Bar(); foo.addFive(); System.out.println(”Value: “+ foo.a); What is the result?()A
Value: 3B
Value: 8C
Value: 13D
Compilation fails.E
The code runs with no output.F
An exception is thrown at runtime.
考题
单选题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 0B
Baz has the value of 1C
Baz has the value of 2D
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; What is the result?()A
Baz has the value of 0B
Baz has the value of 1C
Baz has the value of 2D
An exception is thrown.E
The code will not compile.
考题
多选题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; }AA Bar is a Baz.BA Foo has a Bar.CA Baz is a Foo.DA Foo is a Baz.EA Baz has a Bar.
考题
单选题int index = 1; boolean test = new Boolean; boolean foo= test [index]; What is the result?()A
Foo has the value of 0.B
Foo has the value of null.C
Foo has the value of true.D
Foo has the value of false.E
An exception is thrown.F
The code will not compile.
考题
单选题Which code determines the int value foo closest to, but not greater than, a double value bar?()A
Int foo = (int) Math.max(bar);B
Int foo = (int) Math.min(bar);C
Int foo = (int) Math.abs(bar);D
Int foo = (int) Math.ceil(bar);E
Int foo = (int) Math.floor(bar);F
Int foo = (int) Math.round(bar);
考题
单选题10. interface Foo { int bar(); } 11. public class Sprite { 12. public int fubar( Foo foo) { return foo.bar(); } 13. public void testFoo() { 14. fubar( 15. // insert code here 16.); 17. } 18. } Which code, inserted at line 15, allows the class Sprite to compile?()A
Foo { public int bar() { return 1; } }B
new Foo { public int bar() { return 1; } }C
newFoo() { public int bar(){return 1; } }D
new class Foo { public int bar() { return 1; } }
考题
多选题public class Foo { private int val; public foo(int v) (val = v;) } public static void main (String args) { Foo a = new Foo (10); Foo b = new Foo (10); Foo c = a; int d = 10; double e = 10.0; } Which three logical expression evaluate to true? ()A(a ==c)B(d ==e)C(b ==d)D(a ==b)E(b ==c)F(d ==10.0)
考题
单选题现有: 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. } 和四个声明: Foo doStuff (int x) { return new Foo(); } Foo doStuff (int x) { return new SuperFoo(); } SuperFoo doStuff(int x) { return new Foo(); } SuperFoo doStuff(int y) { return new SuperFoo(); } 分别插入到第8行,有几个可以通过编泽?()A
1B
2C
3D
4
考题
单选题Given: 8.int index = 1: 9.Boolean [] test = new boolcan [3]; 10.boolcan foo = test [index]; What is the result()?A
foo has the value of 0.B
foo has the value of null.C
foo has the value of true.D
foo has the value of false.E
An-exception is thrown.F
The code will not compile.
考题
单选题int index = 1; String test = new String; String foo = test[index]; What is the result?()A
Foo has the value “”B
Foo has the value nullC
An exception is thrownD
The code will not compile
考题
单选题int index = 1; String [] test = new String[3]; String foo = test[index]; What is the result?()A
Foo has the value “”B
Foo has the value nullC
An exception is thrownD
The code will not compile
热门标签
最新试卷