
Oracle Java Standard Edition 5 Programmer Certified Professional - 1Z0-853 Exam Questions
QUESTION NO: 1
Given:
11.
public class ItemTest {
12.
private final int id;
13.
public ItemTest(int id) { this.id = id; }
14.
public void updateId(int newId) { id = newId; }
15.
16.
public static void main(String[] args) {
17.
ItemTest fa = new ItemTest(42);
18.
fa.updateId(69);
19.
System.out.println(fa.id);
20.
}
21.
}
What is the result?
Given:
11.
public class ItemTest {
12.
private final int id;
13.
public ItemTest(int id) { this.id = id; }
14.
public void updateId(int newId) { id = newId; }
15.
16.
public static void main(String[] args) {
17.
ItemTest fa = new ItemTest(42);
18.
fa.updateId(69);
19.
System.out.println(fa.id);
20.
}
21.
}
What is the result?
Correct Answer: A
QUESTION NO: 2
Given:
10.
interface A { public int getValue(); }
11.
class B implements A {
12.
public int getValue() { return 1; }
13.
}
14.
class C extends B {
15.
// insert code here
16.
}
Which three code fragments, inserted individually at line 15, make use of polymorphism? (Choose three.)
Given:
10.
interface A { public int getValue(); }
11.
class B implements A {
12.
public int getValue() { return 1; }
13.
}
14.
class C extends B {
15.
// insert code here
16.
}
Which three code fragments, inserted individually at line 15, make use of polymorphism? (Choose three.)
Correct Answer: B,C,E
QUESTION NO: 3
DRAG DROP
Click the Task button.

DRAG DROP
Click the Task button.

Correct Answer:

QUESTION NO: 4
DRAG DROP
Click the Task button.

DRAG DROP
Click the Task button.

Correct Answer:

QUESTION NO: 5
DRAG DROP
Click the Task button.

DRAG DROP
Click the Task button.

Correct Answer:

QUESTION NO: 6
DRAG DROP
Click the Task button.

DRAG DROP
Click the Task button.

Correct Answer:

QUESTION NO: 7
Given:
11.
class Snoochy {
12.
Boochy booch;
13.
public Snoochy() { booch = new Boochy(this); }
14.
}
15.
16.
class Boochy {
17.
Snoochy snooch;
18.
public Boochy(Snoochy s) { snooch = s; }
19.
}
And the statements:
21.
public static void main(String[] args) {
22.
Snoochy snoog = new Snoochy();
23.
snoog = null;
24.
// more code here
25.
}
Which statement is true about the objects referenced by snoog, snooch, and booch immediately after line 23 executes?
Given:
11.
class Snoochy {
12.
Boochy booch;
13.
public Snoochy() { booch = new Boochy(this); }
14.
}
15.
16.
class Boochy {
17.
Snoochy snooch;
18.
public Boochy(Snoochy s) { snooch = s; }
19.
}
And the statements:
21.
public static void main(String[] args) {
22.
Snoochy snoog = new Snoochy();
23.
snoog = null;
24.
// more code here
25.
}
Which statement is true about the objects referenced by snoog, snooch, and booch immediately after line 23 executes?
Correct Answer: E
QUESTION NO: 8
Given
11.
public interface Status {
12.
/* insert code here */ int MY_VALUE = 10;
13.
}
Which three are valid on line 12? (Choose three.)
Given
11.
public interface Status {
12.
/* insert code here */ int MY_VALUE = 10;
13.
}
Which three are valid on line 12? (Choose three.)
Correct Answer: A,C,E
QUESTION NO: 9
Which three statements concerning the use of the java.io.Serializable interface are true? (Choose three.)
Which three statements concerning the use of the java.io.Serializable interface are true? (Choose three.)
Correct Answer: B,D,E




