Back to Oracle Certified Professional Java SE 17 Developer 1Z0-829 questions

Scenario-based practice

Refer to the Exhibit Practice Questions

Practise Oracle Certified Professional Java SE 17 Developer 1Z0-829 practice questions — original exam-style scenarios covering every exam domain, with detailed explanations, wrong-answer analysis, and common exam traps.

15
scenario questions
1Z0-829
exam code
Oracle
vendor

Scenario guide

How to approach refer to the exhibit practice questions

Practise exhibit-style questions that ask you to read a topology, table, command output or diagram before choosing the best answer.

Quick answer

Exhibit-style questions test whether you can read a topology, command output, diagram or table before choosing the best answer.

How to extract the relevant detail from an exhibit.

How topology, command output or routing information affects the answer.

How to avoid answering from memory before reading the evidence.

How to map the exhibit back to the exam objective.

Related practice questions

Related 1Z0-829 topic practice pages

Scenario questions usually connect to one or more exam topics. Use these links to review the underlying concepts behind the scenario.

Practice set

Practice scenarios

Question 1hardmultiple choice
Full question →

What is the result of executing the code in the exhibit?

Exhibit

Refer to the exhibit.
```
List<String> list = new ArrayList<>(List.of("A", "B", "C"));
for (String s : list) {
    if (s.equals("B")) {
        list.remove(s);
    }
}
System.out.println(list);
```
Question 2mediummultiple choice
Full question →

Given the exhibit, what is the output?

Exhibit

Refer to the exhibit.

Locale locale = new Locale("en", "US");
NumberFormat nf = NumberFormat.getPercentInstance(locale);
nf.setMinimumFractionDigits(2);
System.out.println(nf.format(0.125));
Question 3mediummultiple choice
Full question →

Refer to the exhibit. What is the result?

Exhibit

sealed class Shape permits Circle, Rectangle {
    void draw() { System.out.println("Shape"); }
}
non-sealed class Circle extends Shape {
    void draw() { System.out.println("Circle"); }
}
final class Rectangle extends Shape {
    void draw() { System.out.println("Rectangle"); }
}
class Triangle extends Shape {  // Line 10
    void draw() { System.out.println("Triangle"); }
}
Question 4mediummultiple choice
Full question →

Refer to the exhibit. What is the output?

Exhibit

List<Integer> numbers = List.of(1, 2, 3, 4, 5);
int sum = numbers.stream()
                 .reduce(0, (a, b) -> a + b);
System.out.println(sum);
Question 5hardmultiple choice
Full question →

In the exhibit, if an IOException occurs during closing of both resources, which resource's close exception is returned by e.getSuppressed()?

Exhibit

Refer to the exhibit.

try (FileInputStream fis = new FileInputStream("file.txt");
     BufferedInputStream bis = new BufferedInputStream(fis)) {
    // read data
} catch (IOException e) {
    System.out.println(e.getMessage());
    Throwable[] suppressed = e.getSuppressed();
}
Question 6hardmultiple choice
Full question →

Refer to the exhibit. What is the most likely cause of this exception?

Exhibit

Exception in thread "main" java.io.InvalidClassException: com.example.User; local class incompatible: stream classdesc serialVersionUID = 5564992945715864724, local class serialVersionUID = -4978412458979645732
Question 7mediummultiple choice
Full question →

Refer to the exhibit. Which of the following best describes the effective permissions granted to the application?

Exhibit

Policy file snippet:
grant codeBase "file:/home/user/app/-" {
    permission java.io.FilePermission "/data/-", "read,write";
    permission java.net.SocketPermission "*", "connect";
};
Question 8mediummultiple choice
Full question →

Refer to the exhibit. What is the output?

Exhibit

List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5);
int sum = numbers.stream()
    .filter(n -> n % 2 == 0)
    .mapToInt(n -> n * 2)
    .sum();
System.out.println(sum);
Question 9easymultiple choice
Full question →

Refer to the exhibit. What is the result?

Exhibit

List<String> list = Arrays.asList("a", "b", "c");
Stream<String> stream = list.stream();
stream.forEach(System.out::print);
stream.forEach(System.out::print);
Question 10hardmultiple choice
Full question →

Given the exhibit, what is the output? (Assume America/New_York observes daylight saving time, with spring forward on March 12, 2023 at 2:00 AM to 3:00 AM.)

Exhibit

Refer to the exhibit.

DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
ZonedDateTime zdt = ZonedDateTime.parse("2023-03-12 02:30:00 America/New_York", formatter);
System.out.println(zdt);
Question 11hardmultiple choice
Full question →

Refer to the exhibit. What is the output?

Exhibit

List<String> names = Arrays.asList("Alice", "Bob", "Charlie", "David");
Map<Integer, List<String>> grouped = names.stream()
    .collect(Collectors.groupingBy(String::length));
System.out.println(grouped);
Question 12mediummultiple choice
Full question →

What is the output of the code in the exhibit?

Exhibit

Refer to the exhibit.

Exhibit:
```
NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.GERMANY);
double value = 1234.5678;
System.out.println(nf.format(value));
```
Question 13mediummultiple choice
Full question →

Refer to the exhibit. A Java application is deployed in /opt/app/lib/ and attempts to perform the following operations: 1) Read the file /data/config/settings.xml 2) Write to the file /logs/app.log 3) Read the file /data/config/subdir/extra.conf Which statement is true?

Exhibit

grant codeBase "file:/opt/app/lib/*" {
    permission java.io.FilePermission "/data/config/*", "read";
    permission java.io.FilePermission "/logs/app.log", "write";
};
Question 14mediummultiple choice
Full question →

Which statement is true about the result of executing the jlink command shown in the exhibit?

Network Topology
jlinkmodule-path modsadd-modules com.example.appoutput myimageRefer to the exhibit.
Question 15mediummultiple choice
Full question →

Refer to the exhibit. What is the output?

Exhibit

List<Integer> numbers = Arrays.asList(1,2,3,4,5);
long count = numbers.stream().filter(n -> n%2==0).count();
System.out.println("Count: " + count);

These 1Z0-829 practice questions are part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style 1Z0-829 questions with detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics.