Oracle 1Z0-829 Certification Sample Questions and Answers

1Z0-829 PDF, 1Z0-829 Dumps PDF Free Download, 1Z0-829 Latest Dumps Free PDF, Java SE Developer PDF DumpsThe Oracle Java SE Developer (1Z0-829) Sample Question Set is designed to help you prepare for the Oracle Certified Professional - Java SE 17 Developer certification exam. To become familiar with the actual Oracle Certification exam environment, we suggest you try our Sample Oracle 1Z0-829 Certification Practice Exam.

This Oracle Java SE 17 Developer certification sample practice test and sample question set are designed for evaluation purposes only. If you want to test your Oracle 1Z0-829 knowledge to identify your areas of improvement and get familiar with the actual exam format, we suggest you prepare with the Premium Oracle Certified Professional - Java SE 17 Developer Certification Practice Exam. Our team of Oracle Java SE experts has designed Questions-Answers for this premium practice exam by collecting inputs from recently certified candidates. Our premium Oracle 1Z0-829 certification practice exam will boost your confidence as well as your actual Oracle Java SE Developer exam result.

Oracle 1Z0-829 Sample Questions:

01. Several threads increment a shared counter using count++.
Which two statements about memory visibility and atomicity are correct?
(Choose two.)
a) Declaring the field volatile guarantees every thread sees the latest write but does not make count++ atomic.
b) Declaring the field volatile turns count++ into a single atomic read-modify-write operation.
c) A volatile field may be incremented by many threads with no risk of lost updates.
d) Replacing the field with an AtomicInteger and calling incrementAndGet() makes each increment atomic.
e) AtomicInteger relies on the synchronized keyword internally to serialize every incrementAndGet() call.
 
02. Does this record compile on Java SE 17?
record Money(long cents) { Money { this.cents = Math.max(0, cents); } }
Choose the accurate assessment.
a) It compiles: the compact constructor assigns the field directly and the implicit field assignment is skipped.
b) It does not compile: a compact constructor may reassign the parameter (cents = ...) but cannot assign the field with this.cents = ....
c) It does not compile: a record may not declare any constructor, only its implicit accessors.
d) It compiles, but a cents() accessor must be declared explicitly to read the field.
 
03. Which two statements about java.nio.file.Files methods in Java SE 17 are correct?
(Choose two.)
a) Files.copy(source, target) automatically creates any missing parent directories of the target.
b) Files.delete(path) throws NoSuchFileException when the file is absent, whereas Files.deleteIfExists(path) returns false in that case.
c) Files.move(source, target) with no CopyOption succeeds silently even when the target already exists.
d) The Stream returned by Files.lines(path) holds an open file handle and should be closed, typically with try-with-resources.
e) Files.readAllLines(path) returns a lazily populated Stream<String> over the file.
 
04. Consider the two dependency forms requires transitive X and requires static X.
Which statements accurately describe their semantics?
(Choose two.)
a) requires transitive X gives any module that reads this module implied readability to X as well.
b) requires transitive X is equivalent to requires X plus a copy of X's exported packages into this module.
c) requires static X makes X mandatory at run time but optional at compile time.
d) requires static X makes X mandatory at compile time but optional at run time.
e) requires transitive X forces every downstream module to add its own explicit requires X.
 
05. Inside a synchronized block, a thread calls someLock.wait() with no timeout argument.
What is the thread's Thread.State while it waits?
a) WAITING, because it called wait() with no timeout and remains suspended until another thread notifies it.
b) BLOCKED, because the call occurs inside a synchronized block.
c) TIMED_WAITING, because wait() always applies an internal timeout.
d) RUNNABLE, because the thread still holds a reference to the monitor object.
 
06. You must read a file that contains character text and process it as String lines. Which of these types is a character stream, designed for decoded text rather than raw bytes?
a) FileInputStream
b) DataInputStream
c) BufferedReader
d) BufferedOutputStream
 
07. Module reporting declares requires telemetry; and module telemetry declares requires reporting;.
What happens when you compile them together?
a) Compilation fails because cyclic dependencies among modules are not permitted in requires directives.
b) Both modules compile and the cycle is resolved lazily by the module graph at run time.
c) It compiles only if one side uses requires static to break the readability cycle.
d) It compiles only when both modules are placed in the same directory on the module path.
 
08. An application submits many jobs to an ExecutorService and then calls es.shutdown().
What is the effect of that call?
a) All running and queued tasks are cancelled at once and their worker threads are interrupted before the call returns.
b) Previously submitted tasks continue to run, no new tasks are accepted, and the call returns without waiting for completion.
c) The call blocks until every previously submitted task has finished, then closes the pool and returns.
d) Newly submitted tasks are still accepted until the work queue drains, after which the pool closes itself.
 
09. Two different modules on the module path each contain a package named com.acme.util, and both are read by the same third module.
What is the result?
a) The two copies are merged so that types from both modules' com.acme.util become available.
b) The module listed first on the command line wins and the other package is silently ignored.
c) Resolution fails because a given package may be defined by only one module readable by another module.
d) It compiles, then throws IllegalAccessError only when a duplicated class is loaded.
 
10. Each line below assigns a method reference to a functional-interface variable.
Which two compile as written?
(Choose two.)
a) Function<String, Integer> f = String::length;
b) Supplier<List<String>> s = ArrayList::new;
c) Predicate<String> p = String::length;
d) Comparator<String> cmp = String::equals;
e) Runnable r = String::isEmpty;

Answers:

Question: 01

Answer: a, d

Question: 02

Answer: b

Question: 03

Answer: b, d

Question: 04

Answer: a, d

Question: 05

Answer: a

Question: 06

Answer: c

Question: 07

Answer: a

Question: 08

Answer: b

Question: 09

Answer: c

Question: 10

Answer: a, b

 

Rating: 4.7 / 5 (97 votes)