1Z0-829 Java Platform Overview and Packaging Practice Question
A developer has a module named 'com.example.app' that exports a package 'com.example.api'. Another module 'com.example.client' requires 'com.example.app'. Which directive must be in the module-info.java of 'com.example.client'?
⚠ Common exam trap
Watch out — candidates often confuse 'requires' with 'exports' or 'opens', mistakenly thinking that the client module must export or open the server module's package, rather than simply declaring a dependency.
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
✓
requires com.example.app;
The 'requires' directive in a module-info.java file declares a dependency on another module. For 'com.example.client' to access the exported packages of 'com.example.app', it must include 'requires com.example.app;'. This is the standard mechanism for module dependency in the Java Platform Module System (JPMS).
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
opens com.example.app;
Why it's wrong here
'opens' is for reflective access.
- ✗
uses com.example.api;
Why it's wrong here
'uses' is for service interfaces.
- ✗
exports com.example.api;
Why it's wrong here
Exports are used in the providing module, not the client.
- ✓
requires com.example.app;
Why this is correct
This correctly declares the dependency.
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.