Courseiva
Java Platform Overview and PackagingmediumMultiple ChoiceObjective-mapped

1Z0-829 Java Platform Overview and Packaging Practice Question

Exhibit

module com.example.app {
    requires com.example.lib;
    exports com.example.app.api;
    opens com.example.app.internal to com.example.lib;
}

Refer to the exhibit. Which statement is true about the com.example.app.internal package?

⚠ Common exam trap

Oracle often tests the distinction between `exports` (compile-time and runtime access to public types) and `opens` (runtime reflective access, including private members), and the trap here is that candidates confuse `opens` with `exports` or assume `opens` grants access to all modules unless a `to` clause is specified.

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

It is accessible for deep reflection only by com.example.lib.

The exhibit shows that `com.example.app.internal` is declared with `opens com.example.app.internal to com.example.lib`. The `opens` directive grants deep reflection (access to private members) at runtime, but only to the specified module `com.example.lib`. Other modules cannot reflectively access this package unless they are explicitly listed.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • It is accessible for deep reflection only by com.example.lib.

    Why this is correct

    The opens ... to directive grants reflective access to the named module only.

  • It is accessible for deep reflection by any module.

    Why it's wrong here

    Without 'to', it would be open to all; here it's restricted.

  • It is not accessible for reflection at all.

    Why it's wrong here

    It is open for reflection to com.example.lib.

  • It is exported to all modules.

    Why it's wrong here

    Only exports directive exports; opens does not export.

About these practice questions

This 1Z0-829 question is part of Courseiva's 513-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.