移动端

  • 题王微信公众号

    题王微信公众号

    微信搜“题王网”真题密题、最新资讯、考试攻略、轻松拿下考试

计算机考试 | Oracle认证考试

模式切换

0 0 0
我的错题 我的收藏 学习笔记

章节目录

单选题 Given: What is the result?()

A

Compilation fails.

B

An exception is thrown at runtime.

C

doStuff x = 6 main x = 6

D

doStuff x = 5 main x = 5

E

doStuff x = 5 main x = 6

单选题 Click the Exhibit button. What is the result?()

A

The code will deadlock.

B

The code may run with no output.

C

An exception is thrown at runtime.

D

The code may run with output "0 6".

E

The code may run with output "2 0 6 4".

F

The code may run with output "0 2 4 6".

单选题 Given: What is the result?()

A

Compilation fails.

B

An exception is thrown at runtime.

C

The code executes normally and prints "foo".

D

The code executes normally, but nothing is printed.

多选题 Given: 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 2 to private volatile int x;

D

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

多选题 Which three will compile and run without exception?()

A

private synchronized Object o;

B

void go() {synchronized() { /* code here */ }

C

public synchronized void go() { /* code here */ }

D

private synchronized(this) void go() { /* code here */ }

E

void go() {synchronized(Object.class) { /* code here */ }

F

void go() {Object o = new Object();synchronized(o) { /* code here */ }

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

单选题 Given: What is the result?()

A

harrier

B

shepherd

C

retriever

D

Compilation fails.

E

retriever harrier

多选题 Click the Exhibit button. Which three code fragments, added individually at line 29, produce the output 100?()

A

n = 100;

B

i.setX( 100 );

C

o.getY().setX( 100 );

D

i = new Inner(); i.setX( 100 );

E

o.setY( i ); i = new Inner(); i.setX( 100 );

F

i = new Inner(); i.setX( 100 ); o.setY( i );

单选题 Given: What is the result?()

A

true true

B

false true

C

true false

D

false false

单选题 Given: Which method will complete this class?()

A

public int compareTo(Object o){/*more code here*/}

B

public int compareTo(Score other){/*more code here*/}

C

public int compare(Score s1,Score s2){/*more code here*/}

D

public int compare(Object o1,Object o2){/*more code here*/}

最新资讯

首页 上一页 1 2 3 4 5 下一页 尾页 /

到第