itgle.com

多选题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?()Apublic int blipvert(int x) { return 0; }Bpri

题目
多选题
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?()
A

public int blipvert(int x) { return 0; }

B

private int blipvert(int x) { return 0; }

C

private int blipvert(long x) { return 0; }

D

protected long blipvert(int x, int y) { return 0; }

E

protected int blipvert(long x) { return 0; }

F

protected long blipvert(long x) { return 0; }

G

protected long blipvert(int x) { return 0; }


相似考题
更多“多选题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?()Apublic int blipvert(int x) { return 0; }Bpri”相关问题
  • 第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?()

    • A、 int foo() { /* more code here */ }
    • B、 void foo() { /* more code here */ }
    • C、 public void foo() { /* more code here */ }
    • D、 private void foo() { /* more code here */ }
    • E、 protected void foo() { /* more code here */ }

    正确答案:B,C,E

  • 第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行,有几个可以通过编译 ()

    • A、1
    • B、2
    • C、3
    • D、4
    • E、5

    正确答案:C

  • 第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?() 

    • 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; } }

    正确答案:C

  • 第4题:

    现有:   1. class Synapse {    2.    protected int gap() { return 7; }    3. }   4.     5. class Creb extends Synapse {    6.   // insert code here   7. }    分别插入到第 6 行,哪三行可以编译?()

    • A、 int gap() { return 7; }
    • B、 public int gap() { return 7; }
    • C、 private int gap(int x) { return 7; }
    • D、 protected Creb gap() { return this; }
    • E、 public int gap() { return Integer.getInteger ("42"); }

    正确答案:B,C,E

  • 第5题:

    1. public class Test {  2. public  T findLarger(T x, T y) {  3. if(x.compareTo(y) > 0) {  4. return x;  5. } else {  6. return y;  7. }  8. }  9. }  and:  22. Test t = new Test();  23. // insert code here  Which two will compile without errors when inserted at line 23?()

    • A、 Object x = t.findLarger(123, “456”);
    • B、 int x = t.findLarger(123, new Double(456));
    • C、 int x = t.findLarger(123, new Integer(456));
    • D、 int x = (int) t.findLarger(new Double(123), new Double(456));

    正确答案:A,C

  • 第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行,可以编译?()

    • 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(); }

    正确答案:A,C,D

  • 第7题:

    多选题
    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(); }


    正确答案: B,A
    解析: 暂无解析

  • 第8题:

    多选题
    Given the following code, which method declarations, when inserted at the indicated position, will not cause the program to fail compilation?()   public class Qdd1f {   public long sum(long a, long b) {  return a + b;  }   // insert new method declaration here  }
    A

    public int sum(int a, int b) { return a + b; }

    B

    public int sum(long a, long b) { return 0; }

    C

    abstract int sum();

    D

    private long sum(long a, long b) { return a + b; }

    E

    public long sum(long a, int b) { return a + b; }


    正确答案: B,C
    解析: 暂无解析

  • 第9题:

    多选题
    1. class Synapse {   2. protected int gap() { return 7; }   3. }   4.   5. class Creb extends Synapse { 6. // insert code here  7. }  分别插入到第 6 行,哪三行可以编译?()
    A

    int gap() { return 7; }

    B

    public int gap() { return 7; }

    C

    private int gap(int x) { return 7; }

    D

    protected Creb gap() { return this; }

    E

    public int gap() { return Integer.getInteger (42); }


    正确答案: E,D
    解析: 暂无解析

  • 第10题:

    多选题
    class A {  protected int method1(int a, int b) { return 0; }  }  Which two are valid in a class that extends class A?()
    A

    public int method1(int a, int b) { return 0; }

    B

    private int method1(int a, int b) { return 0; }

    C

    private int method1(int a, long b) { return 0; }

    D

    public short method1(int a, int b) { return 0: }

    E

    static protected int method1(int a, int b) { return 0; }


    正确答案: D,B
    解析: 暂无解析

  • 第11题:

    多选题
    1. class BaseClass {  2. private float x = 1.of;  3. protected float getVar() { return x; }  4. }  5. class SubClass extends BaseClass {  6. private float x = 2.Of;  7. // insert code here 8. }   Which two are valid examples of method overriding when inserted at line 7?()
    A

    float getVar() { return x; }

    B

    public float getVar() { return x; }

    C

    public double getVar() { return x; }

    D

    protected float getVar() { return x; }

    E

    public float getVar(float f) { return f; }


    正确答案: E,A
    解析: 暂无解析

  • 第12题:

    多选题
    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?()
    A

    foreach(x) System.out.println(z);

    B

    for(int z : x) System.out.println(z);

    C

    while( x.hasNext()) System.out.println( x.next());

    D

    for( int i=0; i< x.length; i++ ) System.out.println(x[i]);


    正确答案: B,C
    解析: 暂无解析

  • 第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?()

    • A、 foreach(x) System.out.println(z);
    • B、 for(int z : x) System.out.println(z);
    • C、 while( x.hasNext()) System.out.println( x.next());
    • D、 for( int i=0; i< x.length; i++ ) System.out.println(x[i]);

    正确答案:B,D

  • 第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?()

    • A、 Change line 2 to: public int a;
    • B、 Change line 2 to: protected int a;
    • C、 Change line 13 to: public Sub() { this(5); }
    • D、 Change line 13 to: public Sub() { super(5); }
    • E、 Change line 13 to: public Sub() { super(a); }

    正确答案:C,D

  • 第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行,有几个可以通过编译?()  

    • A、2
    • B、3
    • C、4
    • D、0
    • E、1

    正确答案:C

  • 第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行,有几个可以通过编译?()     

    • A、  1
    • B、  2
    • C、  3
    • D、  4

    正确答案:D

  • 第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?()

    • A、 public void foo() { }
    • B、 public int foo() { return 3; }
    • C、 public Two foo() { return this; }
    • D、 public One foo() { return this; }
    • E、 public Object foo() { return this; }

    正确答案:C,D

  • 第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?()  

    • A、 public int blipvert(int x) { return 0; }
    • B、 private int blipvert(int x) { return 0; }
    • C、 private int blipvert(long x) { return 0; }
    • D、 protected long blipvert(int x, int y) { return 0; }
    • E、 protected int blipvert(long x) { return 0; }
    • F、 protected long blipvert(long x) { return 0; }
    • G、protected long blipvert(int x) { return 0; }

    正确答案:A,C,D,E,F

  • 第19题:

    多选题
    1. public class Test {  2. public  T findLarger(T x, T y) {  3. if(x.compareTo(y) > 0) {  4. return x;  5. } else {  6. return y;  7. }  8. }  9. }  and:  22. Test t = new Test();  23. // insert code here  Which two will compile without errors when inserted at line 23?()
    A

    Object x = t.findLarger(123, “456”);

    B

    int x = t.findLarger(123, new Double(456));

    C

    int x = t.findLarger(123, new Integer(456));

    D

    int x = (int) t.findLarger(new Double(123), new Double(456));


    正确答案: A,D
    解析: 暂无解析

  • 第20题:

    多选题
    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?()
    A

    Change line 2 to: public int a;

    B

    Change line 2 to: protected int a;

    C

    Change line 13 to: public Sub() { this(5); }

    D

    Change line 13 to: public Sub() { super(5); }

    E

    Change line 13 to: public Sub() { super(a); }


    正确答案: C,B
    解析: 暂无解析

  • 第21题:

    多选题
    Given: Which five methods, inserted independently at line 5, will compile?()
    A

    protected int blipvert(long x) { return 0; }

    B

    protected long blipvert(int x) { return 0; }

    C

    private int blipvert(long x) { return 0; }

    D

    private int blipvert(int x) { return 0; }

    E

    public int blipvert(int x) { return 0; }

    F

    protected long blipvert(long x) { return 0; }

    G

    protected long blipvert(int x, int y) { return 0; }


    正确答案: D,B
    解析: 暂无解析

  • 第22题:

    多选题
    现有:   1. class Synapse {    2.    protected int gap() { return 7; }    3. }   4.     5. class Creb extends Synapse {    6.   // insert code here   7. }    分别插入到第 6 行,哪三行可以编译?()
    A

    int gap() { return 7; }

    B

    public int gap() { return 7; }

    C

    private int gap(int x) { return 7; }

    D

    protected Creb gap() { return this; }

    E

    public int gap() { return Integer.getInteger (42); }


    正确答案: E,C
    解析: 暂无解析

  • 第23题:

    多选题
    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?()
    A

    public void foo() { }

    B

    public int foo() { return 3; }

    C

    public Two foo() { return this; }

    D

    public One foo() { return this; }

    E

    public Object foo() { return this; }


    正确答案: C,D
    解析: 暂无解析