Sample questions
Oracle Certified Professional Java SE 17 Developer 1Z0-829 practice questions
Order the steps to compile and run a simple Java program from the command line.
Refer to the exhibit. The exhibit shows a code snippet. What is the output when the variable day is set to Day.WEDNESDAY?
When should LinkedList be preferred over ArrayList?
A developer is designing a service that processes multiple files concurrently. To avoid resource leaks, which practice is essential?
A developer is implementing a custom sort for a list of Employee objects. The Employee class has fields: String name, int age. The list must be sorted first by name (ascending, cas…
A developer needs a collection that stores unique elements and preserves the order in which they were first inserted. Which implementation should be chosen?
A developer needs to concatenate two Stream<String> into one. Which approach is most idiomatic?
Working with Streams and Lambda ExpressionseasySee the answer and why each option is right or wrong →Given: int x=0; do { x++; } while(x<5); How many times does the loop body execute?
Given: Object obj = "Hello"; String result = switch(obj) { case String s -> "String of length " + s.length(); case Integer i -> "Integer"; default -> "Unknown"; }; What is result?
In a modular Java application, where does the module declaration file typically reside?
An application deserializes objects from a network stream. To protect against deserialization attacks, which approach is most effective in Java 17?
A company needs to read a large text file (over 2 GB) line by line in a Java application while minimizing memory footprint. Which approach is most efficient?
A developer needs to ensure that a class `Shape` cannot be instantiated but can be extended. Which modifier should be used?
A company uses a multi-release JAR (MR-JAR) that contains classes for Java 9 and Java 11 in `META-INF/versions/9/` and `META-INF/versions/11/` respectively. The application runs on…
A developer wants to copy all files from one directory to another, preserving file attributes (e.g., last modified time, permissions). Which NIO.2 method is most appropriate?
Which interface should be implemented to create a custom filter for deserialization in Java?
You are developing a batch processing application that reads records from a CSV file and parses each row into an integer ID. The reading method readNextRecord() returns a String an…
A developer creates a Java application that uses the new 'jpackage' tool to create an installer for Windows. The application is modular and has a main class declared in module-info…
A developer needs to iterate over a List<String> and remove elements that are null. Which approach guarantees correct behavior without throwing a ConcurrentModificationException?
Match each JDBC type to its corresponding Java type.
Refer to the exhibit. The module path is correctly set to include the JAR containing the module. What is the most likely issue?
A stream pipeline uses the peek method for debugging. Which statement about peek is correct?
Working with Streams and Lambda ExpressionseasySee the answer and why each option is right or wrong →Which THREE of the following are true about the Optional class? (Choose three.)
Working with Streams and Lambda ExpressionshardSee the answer and why each option is right or wrong →A developer wrote a method that uses a for-each loop to iterate over a list of strings and remove elements that match a certain condition. However, the method throws a ConcurrentMo…