niusouti.com
更多“单选题Given: Which code, inserted at line 14, allows the Sprite class to compile?()A Direction d = NORTH;B Nav.Direction d = NORTH;C Direction d = Direction.NORTH;D Nav.Direction d = Nav.Direction.NORTH;”相关问题
  • 第1题:

    Given:Which code, inserted at line 15, creates an instance of the Point class defined in Line?()

    A.Point p = new Point();

    B.Line.Point p = new Line.Point();

    C.The Point class cannot be instatiated at line 15.

    D.Line l = new Line() ; l.Point p = new l.Point();


    参考答案:B

  • 第2题:

    Click the Exhibit button. Given:Which two statements are true if a NullPointerException is thrown on line 3 of class C? ()

    A.The application will crash.

    B.The code on line 29 will be executed.

    C.The code on line 5 of class A will execute.

    D.The code on line 5 of class B will execute.

    E.The exception will be propagated back to line 27.


    参考答案:B, E

  • 第3题:

    Given:Which code fragment, inserted at line 23, allows the code to compile?()

    A.df = new DateFormat();

    B.df = Date.getFormat();

    C.df = date.getFormat();

    D.df = DateFormat.getFormat();

    E.df = DateFormat.getInstance();


    参考答案:E

  • 第4题:

    If the center of low pressure is due west of you in the Northern Hemisphere, which wind direction should you expect?

    A.South to west

    B.South to east

    C.West to north

    D.North to east


    正确答案:B
    在北半球一个低压正在拟的西部,风向应该怎样判别?东南。

  • 第5题:

    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

  • 第6题:

    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

  • 第7题:

    定义枚举如下:  public  enum  Direction{      EAST,SOUTH,WEST,NORTH      }  下列正确使用该枚举类型的语句是哪项?()    

    • A、Direction Direction=EAST;
    • B、Direction direction=Direction.WEST;
    • C、int a- Direction.NORTH;
    • D、Direction direction=2;

    正确答案:B

  • 第8题:

    多选题
    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
    解析: 暂无解析

  • 第9题:

    单选题
    定义枚举如下:  public  enum  Direction{      EAST,SOUTH,WEST,NORTH      }  下列正确使用该枚举类型的语句是哪项?()
    A

    Direction Direction=EAST;

    B

    Direction direction=Direction.WEST;

    C

    int a- Direction.NORTH;

    D

    Direction direction=2;


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

  • 第10题:

    单选题
    Given:  Which code, inserted at line 15, creates an instance of the Point class defined in Line?()
    A

     Line l = new Line() ; l.Point p = new l.Point();

    B

     Line.Point p = new Line.Point();

    C

     The Point class cannot be instatiated at line 15.

    D

     Point p = new Point();


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

  • 第11题:

    单选题
    10. class Line {  11. public static class Point { }  12. }  13.  14. class Triangle {  15. // insert code here  16. }  Which code, inserted at line 15, creates an instance of the Point class defined in Line?()
    A

     Point p = new Point();

    B

     Line.Point p = new Line.Point();

    C

     The Point class cannot be instatiated at line 15.

    D

     Line 1 = new Line() ; 1.Point p = new 1.Point();


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

  • 第12题:

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


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

  • 第13题:

    Given:Which two, inserted at line 11, will allow the code to compile?()

    A.public class MinMax<?> {

    B.public class MinMax<? extends Number> {

    C.public class MinMax<N extends Object> {

    D.public class MinMax<N extends Number> {

    E.public class MinMax<? extends Object> {

    F.public class MinMax<N extends Integer> {


    参考答案:D, F

  • 第14题:

    Given a class Repetition:Which code should be inserted at line 1 of Demo.java to compile and run Demo to print "pizzapizza"?()

    A.import utils.*;

    B.static import utils.*;

    C.import utils.Repetition.*;

    D.static import utils.Repetition.*;

    E.import utils.Repetition.twice();

    F.import static utils.Repetition.twice;

    G.static import utils.Repetition.twice;


    参考答案:F

  • 第15题:

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


    参考答案:C

  • 第16题:

    In the Northern Hemisphere a wind is said to veer when the wind ______.

    A.changes direction clockwise, as from north to east, etc

    B.changes direction counterclockwise, as from south to east, etc

    C.changes direction violently and erratically

    D.remains constant in direction and speed


    正确答案:A
    在北半球大风的风向会顺时针旋转,例如北到东。

  • 第17题:

    10. class Line {  11. public static class Point { }  12. }  13.  14. class Triangle {  15. // insert code here  16. }  Which code, inserted at line 15, creates an instance of the Point class defined in Line?() 

    • A、 Point p = new Point();
    • B、 Line.Point p = new Line.Point();
    • C、 The Point class cannot be instatiated at line 15.
    • D、 Line 1 = new Line() ; 1.Point p = new 1.Point();

    正确答案:B

  • 第18题:

    10. class Nav{  11. public enum Direction { NORTH, SOUTH, EAST, WEST }  12. }  13. public class Sprite{  14. // insert code here  15. }  Which code, inserted at line 14, allows the Sprite class to compile?() 

    • A、 Direction d = NORTH;
    • B、 Nav.Direction d = NORTH;
    • C、 Direction d = Direction.NORTH;
    • D、 Nav.Direction d = Nav.Direction.NORTH;

    正确答案:D

  • 第19题:

    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

  • 第20题:

    多选题
    Given: 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 */ }


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

  • 第21题:

    单选题
    10. class Nav{  11. public enum Direction { NORTH, SOUTH, EAST, WEST }  12. }  13. public class Sprite{  14. // insert code here  15. }  Which code, inserted at line 14, allows the Sprite class to compile?()
    A

     Direction d = NORTH;

    B

     Nav.Direction d = NORTH;

    C

     Direction d = Direction.NORTH;

    D

     Nav.Direction d = Nav.Direction.NORTH;


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

  • 第22题:

    单选题
    In the Northern Hemisphere a wind is said to veer when the wind().
    A

    Changes direction clockwise,as from north to east,etc

    B

    Changes direction violently and erratically

    C

    Remains constant in direction and speed

    D

    Changes direction counterclockwise,as from south to east,etc


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

  • 第23题:

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


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

  • 第24题:

    单选题
    Given: Which code, inserted at line 14, allows the Sprite class to compile?()
    A

    Direction d = NORTH;

    B

    Nav.Direction d = NORTH;

    C

    Direction d = Direction.NORTH;

    D

    Nav.Direction d = Nav.Direction.NORTH;


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