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 |
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.)
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.)
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?

