public int blipvert(int x) { return 0; }
private int blipvert(int x) { return 0; }
private int blipvert(long x) { return 0; }
protected long blipvert(int x, int y) { return 0; }
protected int blipvert(long x) { return 0; }
protected long blipvert(long x) { return 0; }
protected long blipvert(int x) { return 0; }
第1题:
class One { void foo() {} } class Two extends One { //insert method here } Which three methods, inserted individually at line 14, will correctly complete class Two?()
第2题:
1.class SuperFo{ 2. SuperFo doStuff(int x){ 3.return new SuperFo() 4.} 5.} 6. 7.class Foo extends SuperFo{ 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行,有几个可以通过编译 ()
第3题:
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?()
第4题:
现有: 1. class Synapse { 2. protected int gap() { return 7; } 3. } 4. 5. class Creb extends Synapse { 6. // insert code here 7. } 分别插入到第 6 行,哪三行可以编译?()
第5题:
1. public class Test { 2. public
第6题:
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行,可以编译?()
第7题:
int doStuff() { return 42; }
int doStuff(int x) { return 42; }
Foo doStuff(int x) { return new Foo(); }
SuperFoo doStuff(int x) { return new Foo(); }
第8题:
public int sum(int a, int b) { return a + b; }
public int sum(long a, long b) { return 0; }
abstract int sum();
private long sum(long a, long b) { return a + b; }
public long sum(long a, int b) { return a + b; }
第9题:
int gap() { return 7; }
public int gap() { return 7; }
private int gap(int x) { return 7; }
protected Creb gap() { return this; }
public int gap() { return Integer.getInteger (42); }
第10题:
public int method1(int a, int b) { return 0; }
private int method1(int a, int b) { return 0; }
private int method1(int a, long b) { return 0; }
public short method1(int a, int b) { return 0: }
static protected int method1(int a, int b) { return 0; }
第11题:
float getVar() { return x; }
public float getVar() { return x; }
public double getVar() { return x; }
protected float getVar() { return x; }
public float getVar(float f) { return f; }
第12题:
foreach(x) System.out.println(z);
for(int z : x) System.out.println(z);
while( x.hasNext()) System.out.println( x.next());
for( int i=0; i< x.length; i++ ) System.out.println(x[i]);
第13题:
10. public class Bar { 11.static void foo(int...x) { 12. // insert code here 13. } 14. } Which two code fragments, inserted independently at line 12, will allow the class to compile?()
第14题:
1. class Super { 2. private int a; 3. protected Super(int a) { this.a = a; } 4. } ..... 11. class Sub extends Super { 12. public Sub(int a) { super(a); } 13. public Sub() { this.a= 5; } 14. } Which two, independently, will allow Sub to compile?()
第15题:
1. class Over{ 2. int doIt(long x) { return 3;} 3. } 4. 5. class Under extends Over{ 6. //insert code here 7. } 和四个方法: short doIt(int y) {return 4;} int doIt(long x,long y){return 4;} private int doIt(Short y){ return 4;} protected int doIt(long x){return 4;} 分别插入到第6行,有几个可以通过编译?()
第16题:
现有: 1.class Over { 2.int dolt (long x) { return 3; } 3. } 4. 5. class Under extends Over { 6.//insert code here 7. } 和四个方法: short dolt (int y) { return 4; } int dolt(long Xr long y) { return 4; } private int dolt(short y) { return 4; } protected int dolt (long x) { return 4; } 分别插入到第6行,有几个可以通过编译?()
第17题:
class One { public One foo() { return this; } } class Two extends One { public One foo() { return this; } } class Three extends Two { // insert method here } Which two methods, inserted individually, correctly complete the Three class?()
第18题:
1. public class Blip { 2. protected int blipvert(int x) { return 0; } 3. } 4. class Vert extends Blip { 5. // insert code here 6. } Which five methods, inserted independently at line 5, will compile?()
第19题:
Object x = t.findLarger(123, “456”);
int x = t.findLarger(123, new Double(456));
int x = t.findLarger(123, new Integer(456));
int x = (int) t.findLarger(new Double(123), new Double(456));
第20题:
Change line 2 to: public int a;
Change line 2 to: protected int a;
Change line 13 to: public Sub() { this(5); }
Change line 13 to: public Sub() { super(5); }
Change line 13 to: public Sub() { super(a); }
第21题:
protected int blipvert(long x) { return 0; }
protected long blipvert(int x) { return 0; }
private int blipvert(long x) { return 0; }
private int blipvert(int x) { return 0; }
public int blipvert(int x) { return 0; }
protected long blipvert(long x) { return 0; }
protected long blipvert(int x, int y) { return 0; }
第22题:
int gap() { return 7; }
public int gap() { return 7; }
private int gap(int x) { return 7; }
protected Creb gap() { return this; }
public int gap() { return Integer.getInteger (42); }
第23题:
public void foo() { }
public int foo() { return 3; }
public Two foo() { return this; }
public One foo() { return this; }
public Object foo() { return this; }