10. class Nav{  11. public enum Direction { NORTH, SOUTH, EA

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

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Given:10. interface Data { public void load(); }11. abstract class Info { public abstract void load(); }Which class correctly uses the Data interface and Info class?()()

A.

B.

C.

D.

E.

F.


参考答案:A

第2题:

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
在北半球一个低压正在拟的西部,风向应该怎样判别?东南。

第3题:

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

A.DirectionDirection=EAST;

B.Directiondirection=Direction.WEST;

C.inta-Direction.NORTH;

D.Directiondirection=2;


参考答案:B

第4题:

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

第5题:

In the Northern Hemisphere, if the center of a high pressure area is due west of you, what wind direction would you expect?______.

A.South to west

B.South to east

C.North to west

D.North to east


正确答案:C
在北半球,如果高压中心在你的西部,你预料到是什么风向?西北风。

第6题:

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;


参考答案:D

第7题:

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
在北半球大风的风向会顺时针旋转,例如北到东。

第8题:

classNav{11.publicenumDirection{NORTH,SOUTH,EAST,WEST}12.}13.publicclassSprite{14.//insertcodehere15.}Whichcode,insertedatline14,allowstheSpriteclasstocompile?()

A.Directiond=NORTH;

B.Nav.Directiond=NORTH;

C.Directiond=Direction.NORTH;

D.Nav.Directiond=Nav.Direction.NORTH;


参考答案:D

第9题:

10. public class ClassA {  11. public void count(int i) {  12. count(++i);  13. }  14. }  And:  20. ClassA a = new ClassA();  21. a.count(3);  Which exception or error should be thrown by the virtual machine?() 

  • A、 StackOverflowError
  • B、 NullPointerException
  • C、 NumberFormatException
  • D、 IllegalArgumentException
  • E、 ExceptionlnlnitializerError

正确答案:A

第10题:

10. abstract public class Employee {  11. protected abstract double getSalesAmount();  12. public double getCommision() {  13. return getSalesAmount() * 0.15;  14. }  15. }  16. class Sales extends Employee {  17. // insert method here  18. }  Which two methods, inserted independently at line 17, correctly complete the Sales class?()

  • A、 double getSalesAmount() { return 1230.45; }
  • B、 public double getSalesAmount() { return 1230.45; }
  • C、 private double getSalesAmount() { return 1230.45; }
  • D、 protected double getSalesAmount() { return 1230.45; }

正确答案:B,D

更多相关问题