↓ Try a sample question (with explanation)

Oracle · Practice questions

1Z0-819 Java SE 11 Developer Exam

Study 203 1Z0-819 Java SE 11 Developer Exam practice questions with explanations. 21 of them are free to try, no sign-up needed.

Buy to unlock all questions, full reading mode and PDFs.

About this question bank

Questions
203 in total
Free to try
21 questions (no sign-up)
Exam domains
5 domains
Price
JPY 1,500 (≈ US$10; shown in your local currency at checkout) · one-time payment · 3 months
PDF
Japanese–English · Chinese–English · Korean–English · English (for buyers)
Data version
2026-12

About this exam

Oracle's certification exam for Java SE 11; passing this exam earned the Oracle Certified Professional: Java SE 11 Developer credential. It was retired on November 30, 2026. It covered data types, control flow, object-oriented design, exceptions, collections and generics, lambdas and streams, modules, I/O, concurrency, and JDBC.

Try a sample question

This is an original sample question written by itmoshi based on the exam objectives.

What happens when the program in the exhibit is compiled and run?

Exhibit
import java.util.*;

public class Copies {
    public static void main(String[] args) {
        List<Integer> a = Arrays.asList(1, 2, 3);
        a.set(0, 9);
        List<Integer> b = List.copyOf(a);
        a.set(1, 8);
        System.out.println(a + " " + b);
        b.set(2, 7);
        System.out.println(b);
    }
}
  1. AAn UnsupportedOperationException is thrown at a.set(0, 9) and nothing is printed
  2. B[9, 8, 3] [9, 8, 3] is printed, then an UnsupportedOperationException is thrown
  3. C[9, 8, 3] [9, 2, 3] is printed, then an UnsupportedOperationException is thrown
  4. D[9, 8, 3] [9, 2, 3] is printed, then [9, 2, 7] is printed and the program ends normally
Show answer and explanation

Answer:C It prints [9, 8, 3] [9, 2, 3], then b.set(2, 7) throws an UnsupportedOperationException.

Why it is correct

The list returned by Arrays.asList has a fixed size but allows set, so a becomes [9, 2, 3]. List.copyOf returns an unmodifiable list holding a copy of the elements at that moment, so b stays [9, 2, 3] and is not affected by the later a.set(1, 8). The first line printed is therefore [9, 8, 3] [9, 2, 3]. Calling set on the unmodifiable b then throws UnsupportedOperationException, so the second println never runs.

The other options

  • ✗ A What an Arrays.asList list forbids is changing its size with add or remove; set is allowed. The exception appears only when you try to change the size.
  • ✗ B This treats b as a view of a. Given an Arrays.asList source as in this example, List.copyOf returns an unmodifiable snapshot of its current contents, so later replacements in a do not show up in b. If you want changes to the original to be visible, use a view such as Collections.unmodifiableList.
  • ✗ D The list returned by List.copyOf is unmodifiable, so both set and add throw UnsupportedOperationException. For a modifiable copy, use new ArrayList<>(a).

Key takeaway

Arrays.asList → fixed size (set OK, add/remove not). List.of / List.copyOf → unmodifiable (no set either); a copyOf result does not reflect later additions, removals, or replacements in the source. Collections.unmodifiableList → unmodifiable view (changes to the original show through).

Try 21 questions like this for free

Most frequent topics

  1. Java data types and variables35 questions
  2. Collections and generics33 questions
  3. Inheritance and polymorphism32 questions
  4. Methods and encapsulation18 questions
  5. Inner classes and lambda expressions16 questions
  6. I/O and NIO.211 questions

Number of questions per topic among the 203 in this bank (top topics), as classified by itmoshi.

Exam domains

  1. Java Basics70 questions
  2. Object-Oriented Programming59 questions
  3. Core Java APIs54 questions
  4. Module System12 questions
  5. JDBC and Security8 questions

Other Oracle exams

← All exams

itmoshi is an unofficial study service and is not affiliated with Oracle or any exam provider.