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

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

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

第3题:

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

A.DirectionDirection=EAST;

B.Directiondirection=Direction.WEST;

C.inta-Direction.NORTH;

D.Directiondirection=2;


参考答案:B

第4题:

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

第5题:

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

第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题:

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

第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题:

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

第10题:

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

更多相关问题