โ† All 1Z0-811 Flashcard Decks

Java Development and Deployment Flashcards

7 cards from real 1Z0-811 practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 Java Development and Deployment flashcards as text
  1. Which command compiles a Java source file named `Hello.java` and places the output in a directory called `out`?

    Answer: javac -d out Hello.java

    The `javac -d ` option specifies the destination directory for compiled `.class` files.

  2. What is the result of running `java -jar app.jar` when the manifest file has no `Main-Class` attribute?

    Answer: An error is thrown indicating no main manifest attribute

    Without a `Main-Class` attribute in MANIFEST.MF, the JVM cannot determine the entry point and reports an error.

  3. Which module directive is used to allow reflective access to all packages in a module by a specific other module?

    Answer: opens to

    The `opens` directive grants reflective access (e.g., for frameworks) while `exports` only grants compile/run-time API access.

  4. What does the `javap -c` command display for a `.class` file?

    Answer: Disassembled JVM bytecode instructions

    `javap -c` disassembles and prints the bytecode instructions for each method in the class file.

  5. In a multi-release JAR, where should Java 11-specific class files be placed?

    Answer: META-INF/versions/11/

    Multi-release JARs place version-specific classes under `META-INF/versions//` where N is the Java version.

  6. Which `java` command-line option sets the module path?

    Answer: --module-path

    `--module-path` (or `-p`) specifies where the JVM looks for named modules, analogous to `-classpath` for the legacy class path.

  7. What happens when you use `requires transitive com.example.util;` in a module descriptor?

    Answer: Modules that require your module automatically also read com.example.util

    `requires transitive` implies that any module depending on your module implicitly also depends on `com.example.util`, enabling implied readability.