多选题public interface Foo{  int k = 4;   }   Which three are equivalent to line 2? ()AFinal int k = 4;BPublic int k = 4;CStatic int k = 4;DPrivate int k = 4;EAbstract int k = 4;FVolatile int k = 4;GTransient int k = 4;HProtected int k = 4;

题目
多选题
public interface Foo{  int k = 4;   }   Which three are equivalent to line 2? ()
A

Final int k = 4;

B

Public int k = 4;

C

Static int k = 4;

D

Private int k = 4;

E

Abstract int k = 4;

F

Volatile int k = 4;

G

Transient int k = 4;

H

Protected int k = 4;


相似考题
更多“public interface Foo{  int k = 4;   }   Which three are equi”相关问题
  • 第1题:

    public interface Foo{  int k = 4;  }   Which three are equivalent to line 2?()   

    • A、 Final int k = 4;
    • B、 Public int k = 4;
    • C、 Static int k = 4;
    • D、 Private int k = 4;
    • E、 Abstract int k = 4;
    • F、 Volatile int k = 4;

    正确答案:A,B,C

  • 第2题:

    public interface Foo {  int k = 4; 3. }  Which three are equivalent to line 2?()

    • A、 final int k = 4;
    • B、 public int k = 4;
    • C、 static int k = 4;
    • D、 abstract int k = 4;
    • E、 volatile int k = 4;
    • F、 protected int k = 4;

    正确答案:A,B,C

  • 第3题:

    Given:  1.  public interface Foo {  2.  int k = 4:  3.  }   Which three are equivalent to line 2?()

    • A、 final int k = 4:
    • B、 public int k = 4:
    • C、 static int k = 4:
    • D、 private int k = 4:
    • E、 abstract int k = 4:
    • F、 volatile int k = 4:
    • G、 transient int k = 4:
    • H、 protected int k = 4:

    正确答案:A,B,C

  • 第4题:

    11. public interface Status {  12. /* insert code here */ int MY_VALUE = 10;  13. }  Which three are valid on line 12?()

    • A、 final
    • B、 static
    • C、 native
    • D、 public
    • E、 private
    • F、 abstract
    • G、 protected

    正确答案:A,B,D

  • 第5题:

    interface foo {   int k = 0;   }    public class test implements Foo (   public static void main(String args) (    int i;   Test test = new test ();   i= test.k;   i= Test.k;   i= Foo.k;   )   )   What is the result? ()

    • A、 Compilation succeeds.
    • B、 An error at line 2 causes compilation to fail.
    • C、 An error at line 9 causes compilation to fail.
    • D、 An error at line 10 causes compilation to fail.
    • E、 An error at line 11 causes compilation to fail.

    正确答案:A

  • 第6题:

    Given 11.public interface Status { 12./* insert code here */ int MY_VALUE = 10; 13.} Which three are valid on line 12?()

    • A、final
    • B、static
    • C、native
    • D、public
    • E、private

    正确答案:A,B,D

  • 第7题:

    多选题
    10. interface Foo {  11. int bar();  12. }  13.  14. public class Beta {  15.  16. class A implements Foo {  17. public int bar() { return 1; }  18. }  19.  20. public int fubar( Foo foo) { return foo.bar(); }  21.  22. public void testFoo() {  23.  24. class A implements Foo {  25. public int bar() { return 2; }  26. }  27.  28. System.out.println( fubar( new A())); 29. }  30.  31. public static void main( String[] argv) {  32. new Beta().testFoo();  33. }  34. }  Which three statements are true?()
    A

    Compilation fails.

    B

    The code compiles and the output is 2.

    C

    If lines 16, 17 and 18 were removed, compilation would fail.

    D

    If lines 24, 25 and 26 were removed, compilation would fail.

    E

    If lines 16, 17 and 18 were removed, the code would compile and the output would be 2.

    F

    If lines 24, 25 and 26 were removed, the code would compile and the output would be 1.


    正确答案: B,E,F
    解析: 暂无解析

  • 第8题:

    单选题
    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; } }


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

  • 第9题:

    多选题
    public interface Foo{  int k = 4;   }   Which three are equivalent to line 2? ()
    A

    Final int k = 4;

    B

    Public int k = 4;

    C

    Static int k = 4;

    D

    Private int k = 4;

    E

    Abstract int k = 4;

    F

    Volatile int k = 4;

    G

    Transient int k = 4;

    H

    Protected int k = 4;


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

  • 第10题:

    多选题
    Given:  1.  public interface Foo {  2.  int k = 4:  3.  }   Which three are equivalent to line 2?()
    A

    final int k = 4:

    B

    public int k = 4:

    C

    static int k = 4:

    D

    private int k = 4:

    E

    abstract int k = 4:

    F

    volatile int k = 4:

    G

    transient int k = 4:

    H

    protected int k = 4:


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

  • 第11题:

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


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

  • 第12题:

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


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

  • 第13题:

    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

  • 第14题:

    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

  • 第15题:

    Which three form part of correct array declarations?()  

    • A、 public int a []
    • B、 static int [] a
    • C、 public [] int a
    • D、 private int a [3]
    • E、 private int [3] a []
    • F、 public final int [] a

    正确答案:A,B,F

  • 第16题:

    public interface Foo{  int k = 4;   }   Which three are equivalent to line 2? ()

    • A、 Final int k = 4;
    • B、 Public int k = 4;
    • C、 Static int k = 4;
    • D、 Private int k = 4;
    • E、 Abstract int k = 4;
    • F、 Volatile int k = 4;
    • G、 Transient int k = 4;
    • H、 Protected int k = 4;

    正确答案:A,B,C

  • 第17题:

    Given:   10. class One {   11. void foo() { }   12. }   13. class Two extends One {   14. //insert method here   15. }   Which three methods, inserted individually at line 14, will correctly complete class Two?()

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

    正确答案:A,C,E

  • 第18题:

    单选题
    interface foo {   int k = 0;   }    public class test implements Foo (   public static void main(String args) (    int i;   Test test = new test ();   i= test.k;   i= Test.k;   i= Foo.k;   )   )   What is the result? ()
    A

     Compilation succeeds.

    B

     An error at line 2 causes compilation to fail.

    C

     An error at line 9 causes compilation to fail.

    D

     An error at line 10 causes compilation to fail.

    E

     An error at line 11 causes compilation to fail.


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

  • 第19题:

    多选题
    public interface Foo {  int k = 4; 3. }  Which three are equivalent to line 2?()
    A

    final int k = 4;

    B

    public int k = 4;

    C

    static int k = 4;

    D

    abstract int k = 4;

    E

    volatile int k = 4;

    F

    protected int k = 4;


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

  • 第20题:

    单选题
    1. interface foo {  2. int k = 0;  3. } 4.    5. public class test implements Foo (  6. public static void main(String args[]) (  7. int i;  8. Test test = new test ();  9. i= test.k;  10.i= Test.k;  11.i= Foo.k;  12.)  13.)  14.        What is the result?()
    A

     Compilation succeeds.

    B

     An error at line 2 causes compilation to fail.

    C

     An error at line 9 causes compilation to fail.

    D

     An error at line 10 causes compilation to fail.

    E

     An error at line 11 causes compilation to fail.


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

  • 第21题:

    多选题
    public interface Foo{  int k = 4;  }   Which three are equivalent to line 2?()
    A

    Final int k = 4;

    B

    Public int k = 4;

    C

    Static int k = 4;

    D

    Private int k = 4;

    E

    Abstract int k = 4;

    F

    Volatile int k = 4;


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

  • 第22题:

    多选题
    Given 11.public interface Status { 12./* insert code here */ int MY_VALUE = 10; 13.} Which three are valid on line 12?()
    A

    final

    B

    static

    C

    native

    D

    public

    E

    private


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

  • 第23题:

    多选题
    public class TestFive {  private int x;  public void foo() {  int current = x;  x = current + 1;  }  public void go() {  for(int i=0;i<5;i++) {  new Thread() {  public void run() {  foo();  System.out.print(x + “, “);  } }.start();  }}}  Which two changes, taken together, would guarantee the output: 1, 2, 3, 4, 5, ?()
    A

    Move the line 12 print statement into the foo() method.

    B

    Change line 7 to public synchronized void go() {.

    C

    Change the variable declaration on line 3 to private volatile int x;.

    D

    Wrap the code inside the foo() method with a synchronized( this ) block.

    E

    Wrap the for loop code inside the go() method with a synchronized block synchronized(this) { // for loop code here }.


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

  • 第24题:

    多选题
    11. public interface Status {  12. /* insert code here */ int MY_VALUE = 10;  13. }  Which three are valid on line 12?()
    A

    final

    B

    static

    C

    native

    D

    public

    E

    private

    F

    abstract

    G

    protected


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