1Z0-829 exports directive Practice Question
A Java 17 application uses the Java Platform Module System (JPMS). The module 'com.example.service' exports 'com.example.service.api' and requires 'java.logging'. Another module 'com.example.client' requires 'com.example.service'. The client module cannot access the 'com.example.service.api' package. What is the most likely reason?
⚠ Common exam trap
The trap is that candidates may trust the stem's assertion that the package is exported, but the most likely reason for the access failure is that the export declaration is missing. Always verify that exports are present in the module declaration.
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
✓
The 'com.example.service.api' package is not exported by 'com.example.service'.
The stem states that the 'com.example.service' module exports 'com.example.service.api', but the most likely reason the client cannot access the package is that the package is not actually exported in the module's module-info.java. In JPMS, a module must explicitly export a package for it to be accessible to other modules. Without an exports directive, other modules cannot access the package even if they have a 'requires' directive. Option C is incorrect because the stem explicitly states that the client requires the service module. Options A and D are not directly related to the client's inability to access the package.
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 'com.example.service' module does not use 'requires transitive' for 'java.logging'.
Why it's wrong here
Incorrect. Whether or not 'java.logging' is required transitively does not affect access to the service module's own exported packages.
- ✓
The 'com.example.service.api' package is not exported by 'com.example.service'.
Why this is correct
Correct. If the 'com.example.service' module does not have an 'exports com.example.service.api' directive, the package is not accessible to any other module, including 'com.example.client'.
- ✗
The 'com.example.client' module does not contain a 'requires com.example.service' directive.
Why it's wrong here
Incorrect. The stem explicitly says that 'com.example.client' requires 'com.example.service', meaning the 'requires' directive is present in its module-info.java.
- ✗
The 'java.logging' module does not export its packages to 'com.example.service'.
Why it's wrong here
Incorrect. The access issue is between the client and the service module, not involving the java.logging module's exports.
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.