Online Access Free 1Z0-851 Practice Test

Exam Code:1Z0-851
Exam Name:Java Standard Edition 6 Programmer Certified Professional Exam
Certification Provider:Oracle
Free Question Number:290
Posted:Aug 30, 2026
Rating
100%

Question 1

Given: public class NamedCounter {
private final String name;
private int count;
public NamedCounter(String name) { this.name = name; }
public String getName() { return name; }
public void increment() { count++; }
public int getCount() { return count; }
public void reset() { count = 0; }
} Which three changes should be made to adapt this class to be used safely by multiple threads? (Choose three.)

Question 2

Given:
2.public class Hi {
3.void m1() { }
4.protected void() m2 { }
5.}
6.class Lois extends Hi {
7.// insert code here
8.}
Which four code fragments, inserted independently at line 7, will compile? (Choose four.)

Question 3

DRAG DROP
Click the Task button.

Question 4

Given:
11.public void go(int x) {
12.assert (x > 0);
13.switch(x) {
14.case 2: ;
15.default: assert false;
16.}
17.}
18.private void go2(int x) { assert (x < 0); } Which statement is true?

Question 5

Given:
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?

Add Comments

Your email address will not be published. Required fields are marked *

insert code
Type the characters from the picture.