ExamDumpster

Free 1Z0-830 sample questions

Each free 1Z0-830 sample question below includes the answer and an explanation. They cover records, streams, threads and pattern matching. Use them to check the language details you might skip in daily work.

Try them in the simulator Same questions, with study, timed and flashcard modes.

Showing 8 of 17 free sample questions.

Question 1Choose one

**Case Study: Logistics System** A logistics company is migrating its tracking system to Java 21. The system processes packages using a sealed hierarchy: ```java sealed interface Package permits Box, Envelope {} record Box(int weight, int h, int w, int d) implements Package {} record Envelope(int weight) implements Package {} ``` The shipping cost calculation requires specific logic: 1. Envelopes under 100g cost $2. 2. Envelopes 100g or more cost $4. 3. Boxes are calculated as `weight * 0.5`, but if the volume (`h*w*d`) exceeds 10,000, there is a $5 surcharge. You need to implement this using a single switch expression with record patterns. Which code snippet correctly implements this logic?

Question 2Choose one

You are creating a `Stream` pipeline to process a list of `Order` objects. Each order has a status. You want to group the orders by status and count them. Which collector should you use?

Question 3Choose one

Which method of the `java.util.concurrent.Executors` class creates an executor that runs each task on a virtual thread?

Question 4Choose one

You are designing a module `com.app.security` that provides an implementation of a service `com.app.api.Cipher`. The implementation class is `com.app.security.AesCipher`. Which directive in `module-info.java` correctly declares this provision?

Question 5Choose one

What happens if a `switch` pattern matching block covers all possible subtypes of a sealed interface but does not include a `default` case?

Question 6Choose one

You are using `java.nio.file.Files.walk(Path start, int maxDepth, FileVisitOption... options)` to traverse a directory structure. You want to ensure the traversal follows symbolic links. Which option should you pass?

Question 7Choose one

Which statement about `try-with-resources` is TRUE regarding the order of closing resources?

Question 8Choose one

When using `Math.round(double a)`, what is the return type?

9 more free samples are waiting

Create a free account to unlock the whole 1Z0-830 sample bank, or get full access to all 253 practice questions in the simulator.

Create account