Courseiva
Java Platform Overview and PackagingeasyMultiple SelectObjective-mapped

1Z0-829 Java Platform Overview and Packaging Practice Question

Which TWO statements are true about the Java Platform Module System (JPMS) introduced in Java 9?

⚠ Common exam trap

Watch out — candidates often confuse the search order of module path vs. class path (A) or mistakenly think automatic modules have a module-info.class (D), when in fact they are automatically derived from JARs without one.

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 module declaration is stored in a file named module-info.java.

The module declaration in JPMS is indeed stored in a file named module-info.java, which is compiled into module-info.class and placed at the root of the module. This file defines the module's name, dependencies (requires), and exported packages (exports).

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 module path is searched after the class path when resolving types.

    Why it's wrong here

    The module path and class path are separate; the class path is used for unnamed module and the module path for named modules.

  • The module declaration is stored in a file named module-info.java.

    Why this is correct

    The module declaration is placed in module-info.java, which is compiled to module-info.class.

  • A module must explicitly export a package to make it accessible to other modules.

    Why this is correct

    By default, a package is not exported; it must be declared with the exports directive.

  • An automatic module is one that has a module-info.class file at its root.

    Why it's wrong here

    An automatic module is created from a JAR placed on the module path without a module-info.class.

  • A named module can access the unnamed module without any explicit declaration.

    Why it's wrong here

    Named modules are not allowed to read the unnamed module unless the --add-reads flag is used.

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

Same concept, more angles

3 more ways this is tested on 1Z0-829

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. Which TWO statements are true about Java modules in Java 17? (Choose two.)

medium
  • A.A module can export a package only to specific modules using 'exports ... to ...'
  • B.The module-info.java file must be compiled with javac and placed in the root of the JAR.
  • C.All packages in a module are automatically exported.
  • D.The jdeps tool can be used to create a module graph.
  • E.The jlink tool creates a JAR file containing the module.

Why A: The 'exports ... to ...' directive in module-info.java restricts the exported package to only the specified target modules, providing fine-grained access control. This is a key feature of the Java module system introduced in Java 9, allowing a module to expose its packages only to trusted modules rather than all other modules.

Variation 2. Which TWO statements are true about the Java module system (JPMS) as of Java 17?

medium
  • A.A named module is defined by a module-info.class file placed in the root of the module.
  • B.An automatic module can contain a module-info.class file.
  • C.A jar file placed on the classpath that lacks module-info.class becomes an automatic module.
  • D.A named module can read an unnamed module by default.
  • E.An unnamed module is created when code is placed on the classpath.

Why A: A named module in JPMS is defined by a module-info.class file (compiled from module-info.java) placed in the root directory of the module. This file declares the module's name, dependencies, and exported packages, making it a fundamental requirement for a named module.

Variation 3. Which TWO statements about Java module types are true?

medium
  • A.An automatic module exports all its packages.
  • B.An automatic module can access all packages of named modules without explicit requires.
  • C.The unnamed module can read only the java.base module.
  • D.A named module requires a module-info.java file at compile time.
  • E.The unnamed module is a named module.

Why A: The Java module system automatically exports all packages of an automatic module, making them accessible to other modules without explicit export declarations. This is a key characteristic of automatic modules, which are created from JAR files placed on the module path without a module-info.java file.

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.