Modular Development & Deployment Practices 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 Modular Development & Deployment Practices flashcards as text
Which `jlink` plugin reduces the size of the runtime image by removing debug information from class files?
Answer: --strip-debug
`--strip-debug` removes debugging information (such as variable names and line numbers) from class files to reduce image size.
A named module `com.util` exports `com.util.api` but not `com.util.internal`. A class in `com.util.internal` is needed by a test on the class path. Which option allows reflective access without modifying module-info.java?
Answer: --add-opens com.util/com.util.internal=ALL-UNNAMED
`--add-opens` grants deep reflective access (private members included) to a package; `ALL-UNNAMED` targets code on the class path (the unnamed module).
What does `jdeps --check ` report?
Answer: Unused exports and requires in the module's descriptor
`jdeps --check` compares the module's declared dependencies against its actual usage and reports unused `requires` or missing ones.
When using `--module-path` and `--class-path` together, how does the JVM resolve type conflicts where the same class exists on both?
Answer: Named modules on the module path take precedence over the unnamed module (class path)
Named modules on the module path shadow any class with the same name on the class path, because named module types are never loaded by the unnamed module's class path.
Which statement correctly describes an `open module` declaration?
Answer: The module allows deep reflection on all its packages at runtime but exports none publicly unless explicitly stated
An `open module` grants reflective access to all packages at runtime (equivalent to `opens` on each package) but does not change compile-time export visibility.
What naming convention does the module system use to derive the name of an automatic module from a JAR filename like `commons-lang3-3.12.0.jar`?
Answer: commons.lang3 (hyphens become dots, version suffix stripped)
The automatic module name is derived by stripping the version suffix and replacing hyphens (and other non-alphanumeric characters) with dots.
Which `javac` option specifies the root directories containing module source code when compiling multiple modules at once?
Answer: --module-source-path
`--module-source-path` tells `javac` where to find the source tree organized by module directories when performing multi-module compilation.