Pass4itsure > Oracle > Oracle Certifications > 1Z0-816 > 1Z0-816 Online Practice Questions and Answers

1Z0-816 Online Practice Questions and Answers

Questions 4

Given this enum declaration:

Examine this code:

System.out.println(Alphabet.getFirstLetter());

What code should be written at line 3 to make this code print A?

A. final String getFirstLetter() { return A.toString(); }

B. static String getFirstLetter() { return Alphabet.values()[1].toString(); }

C. static String getFirstLetter() { return A.toString(); }

D. String getFirstLetter() { return A.toString(); }

Buy Now
Questions 5

Given:

var data = new ArrayList<>();

data.add("Peter");

data.add(30);

data.add("Market Road");

data.set(1, 25);

data.remove(2);

data.set(3, 1000L);

System.out.print(data);

What is the output?

A. [Market Road, 1000]

B. [Peter, 30, Market Road]

C. [Peter, 25, null, 1000]

D. An exception is thrown at run time.

Buy Now
Questions 6

Given: String originalPath = "data\\projects\\a-project\\..\\..\\another-project"; Path path = Paths.get(originalPath); System.out.print(path.normalize());

What is the result?

A. data\another-project

B. data\projects\a-project\another-project

C. data\\projects\\a-project\\..\\..\\another-project

D. data\projects\a-project\..\..\another-project

Buy Now
Questions 7

Given: What is the result?

A. 6910 3

B. 10126 3

C. 3

D. 6104 3

Buy Now
Questions 8

Given:

When is the readObject method called?

A. before this object is deserialized

B. after this object is deserialized

C. before this object Is serialized

D. The method is never called.

E. after this object is serialized

Buy Now
Questions 9

Given:

After which line can we insert assert i < 0 || values[i] <= values[i + 1]; to verify that the values array is partially sorted?

A. after line 8

B. after line 6

C. after line 5

D. after line 10

Buy Now
Questions 10

Given:

Which is true about line 1?

A. If the value is not present, a NoSuchElementException is thrown at run time.

B. It always executes the System.out::print statement.

C. If the value is not present, a NullPointerException is thrown at run time.

D. If the value is not present, nothing is done.

Buy Now
Questions 11

Given the Person class with age and name along with getter and setter methods, and this code fragment:

What will be the result?

A. Aman Tom Peter

B. Tom Aman Peter

C. Aman Peter Tom

D. Tom Peter Aman

Buy Now
Questions 12

Which three guidelines are used to protect confidential information? (Choose three.)

A. Limit access to objects holding confidential information.

B. Clearly identify and label confidential information.

C. Manage confidential and other information uniformly.

D. Transparently handle information to improve diagnostics.

E. Treat user input as normal information.

F. Validate input before storing confidential information.

G. Encapsulate confidential information.

Buy Now
Questions 13

Which two statements independently compile? (Choose two.)

A. List list = new ArrayList();

B. List list = new ArrayList();

C. List list = new ArrayList();

D. List list = new ArrayList();

E. List list = new ArrayList();

Buy Now
Exam Code: 1Z0-816
Exam Name: Java SE 11 Programmer II
Last Update: Jun 07, 2026
Questions: 80
10%OFF Coupon Code: SAVE10

PDF (Q&A)

$49.99

VCE

$55.99

PDF + VCE

$65.99