1Z0-829 Java Platform Overview and Packaging Practice Question
Which two statements are true about Java module declarations? (Choose two.)
⚠ Common exam trap
Many exam-takers confuse the 'uses' directive with 'provides' (Option A) and mistakenly think 'requires' can make a module optional (Option D), when in fact 'requires static' is for optional compilation, not runtime optionality.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
A qualified export allows access to the exported package only to specific modules.
A qualified export in a Java module declaration (using the 'exports ... to ...' syntax) restricts access to the exported package only to the specific modules listed after the 'to' keyword. This provides fine-grained control over which other modules can use the exported types, enhancing encapsulation and security.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The uses directive is used to specify that a module provides a service implementation.
Why it's wrong here
uses declares a service dependency; provides declares an implementation.
- ✗
A module can read another module only if it explicitly requires it.
Why it's wrong here
Modules can also read other modules via requires transitive, and java.base is implicitly required.
- ✓
A qualified export allows access to the exported package only to specific modules.
Why this is correct
Qualified exports restrict accessibility to a comma-separated list of module names.
- ✗
The requires directive can be used to specify a module that is optional.
Why it's wrong here
Optional dependencies require the static modifier: requires static.
- ✓
The opens directive allows reflective access to all types and members in the opened package, including private members.
Why this is correct
opens grants full reflective access at runtime, but not compile-time access.
Visual reference
Go deeper
Related to this question
About these practice questions
Courseiva writes every 1Z0-829 question from scratch — 513 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-829 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-829 exam.