โ† 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 `jar` command option lists the contents of an existing JAR file?

    Answer: jar --list --file app.jar

    `jar --list` (or `jar -tf`) lists all entries in the specified JAR archive.

  2. When module-info.java contains `uses com.example.Printer;`, what does this indicate?

    Answer: The module is a consumer of the Printer service via ServiceLoader

    The `uses` directive registers the module as a consumer of a service type, allowing `ServiceLoader` to discover implementations at runtime.

  3. Which Java 11 feature allows running a single-file source program without explicitly compiling it first?

    Answer: java Hello.java

    Java 11 added the ability to launch single-file source-code programs directly with `java SourceFile.java`, which compiles in memory.

  4. What does the `--show-module-resolution` JVM flag output during startup?

    Answer: A trace of which modules are being resolved and in what order

    `--show-module-resolution` prints resolution steps at startup, useful for diagnosing module graph problems.

  5. Which directory inside a module source tree conventionally holds the `module-info.java` file?

    Answer: The root of the module's source directory

    `module-info.java` is placed at the root of the module's source tree, at the same level as the top-level package directories.

  6. What is the role of the `java.base` module in the Java module system?

    Answer: It is the foundational module that every other module implicitly requires

    `java.base` defines the core JDK APIs and is implicitly required by all modules; you never need to declare `requires java.base`.

  7. Which option passed to `javac` enables preview features in Java 11?

    Answer: --enable-preview combined with --release 11

    Preview features require both `--enable-preview` and `--release ` (or `-source` / `-target`) so the compiler knows the exact release context.