Modules System Flashcards
7 cards from real 1Z0-819 practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Modules System flashcards as text
What is the module name for the foundational Java SE module that all other modules implicitly depend on?
Answer: java.base
java.base is the foundational platform module containing java.lang, java.util, java.io, etc., and every module implicitly requires it.
What command lists all observable modules in the current JDK installation?
Answer: java --list-modules
'java --list-modules' outputs all platform and observable modules available to the current JDK.
A module-info.java declares 'opens com.example.data to com.google.gson;'. What capability does this grant?
Answer: com.google.gson can reflectively access all members including private ones in com.example.data
A qualified 'opens' directive allows the target module to use reflection on all members, including private ones, in the opened package.
What is the key difference between placing a JAR on --class-path versus --module-path?
Answer: On --class-path it joins the unnamed module; on --module-path it becomes an automatic or named module
Classpath JARs are aggregated into the unnamed module, while module-path JARs become named or automatic modules with encapsulation enforced.
Which @Deprecated attribute, added in Java 9 alongside the module system, marks an API slated for removal?
Answer: forRemoval=true
The 'forRemoval=true' attribute on @Deprecated was added in Java 9 to signal that an API is scheduled for removal in a future release.
What does the '--patch-module' option do when launching the JVM?
Answer: Merges additional classes or resources into an existing named module at runtime
'--patch-module module=path' injects additional classes into a named module, useful for testing and patching platform classes.
Which module aggregates all standard Java SE API modules so you can depend on the full Java SE platform at once?
Answer: java.se
'java.se' is an aggregator module that requires all standard Java SE modules (java.desktop, java.sql, java.xml, etc.) transitively.