Question 373 of 509
What is JavahardMultiple ChoiceObjective-mapped

Quick Answer

The answer is that the module com.thirdparty.lib does not export the package containing the required class in its module-info.java. In Java’s module system, a module must explicitly declare which packages are accessible to other modules using the exports directive; without it, even if the module is resolved and the class exists in the JAR, it remains encapsulated and invisible at runtime, causing a NoClassDefFoundError despite successful compilation. This scenario tests your understanding of module exports accessibility in Java modules, a core concept on the Oracle Java Foundations 1Z0-811 exam, where the common trap is assuming compilation guarantees runtime access—compilation only checks that the module is present, not that its packages are exported. Remember the mnemonic: “Compile requires, runtime exports”—a module can be required but still hide its packages until explicitly exported.

1Z0-811 What is Java Practice Question

This 1Z0-811 practice question tests your understanding of what is java. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A development team is building a modular Java application using Java 17. They have defined a module named com.myapp with a module-info.java that includes 'requires com.thirdparty.lib;'. The com.thirdparty.lib module is a third-party library packaged as a modular JAR with its own module-info.class. The application compiles successfully using javac with the module path pointing to the directory containing the JAR. However, when starting the application with java --module-path <path> --module com.myapp, a NoClassDefFoundError occurs for a class from com.thirdparty.lib. The error message indicates the class is not found. The team has confirmed that the JAR file is present in the specified module path and that the class exists in the JAR. No other errors or warnings are displayed. The team is puzzled because the code compiles without issues. What is the most likely cause of this runtime error?

Clue words in this question

Noticing these words before you look at the options changes how you read each choice.

  • Clue: "most likely"

    Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.

Question 1hardmultiple choice
Read the full NAT/PAT explanation →

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 com.thirdparty.lib does not export the package containing the required class in its module-info.java.

In modular Java, a module must export a package for its classes to be accessible by other modules. If com.thirdparty.lib does not export the package containing the required class, that class will not be found at runtime, even though the module is present. This is a common issue when migrating from classpath-based to module-path-based applications. Option A is correct because the module's exports directive is missing. Option B is incorrect because module path order does not affect accessibility of exported packages; it affects module resolution, but the module is resolved. Option C is incorrect because version conflicts typically cause different errors (e.g., NoSuchMethodError). Option D is incorrect because if the library were incompatible, compilation would likely fail or errors would be different.

Key principle: NAT direction and interface roles matter as much as the IP address mapping. Inside/outside designation controls which traffic is translated.

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 order is incorrect, causing a different version of the library to be loaded.

    Why it's wrong here

    Module path order affects resolution, but the error would typically be a resolution error, not NoClassDefFoundError for a particular class.

  • The library is not compatible with Java 17.

    Why it's wrong here

    If the library were incompatible, the error would likely occur during compilation or manifest as a linkage error (e.g., UnsupportedClassVersionError).

  • The application's module requires the wrong version of the library.

    Why it's wrong here

    Version requirements would cause a resolution error at startup, not a NoClassDefFoundError for a specific class that exists.

  • The module com.thirdparty.lib does not export the package containing the required class in its module-info.java.

    Why this is correct

    Even though the module is on the module path, its packages are not accessible without an 'exports' directive.

    Clue confirmation

    The clue word "most likely" in the question point toward this answer.

    Related concept

    Static NAT maps one inside address to one outside address.

Common exam traps

Common exam trap: NAT rules depend on direction and matching traffic

NAT is not only about the public address. The inside/outside interface roles and the ACL or rule that matches traffic are just as important.

Detailed technical explanation

How to think about this question

NAT questions usually test address translation, overload/PAT behaviour, static mappings and whether the right traffic is being translated. Read the interface direction and address terms carefully.

KKey Concepts to Remember

  • Static NAT maps one inside address to one outside address.
  • PAT allows many inside hosts to share one public address using ports.
  • Inside local and inside global describe the private and translated addresses.
  • NAT ACLs identify traffic for translation, not always security filtering.

TExam Day Tips

  • Identify inside and outside interfaces first.
  • Check whether the scenario needs static NAT, dynamic NAT or PAT.
  • Do not confuse NAT matching ACLs with normal packet-filtering intent.

Key takeaway

NAT direction and interface roles matter as much as the IP address mapping. Inside/outside designation controls which traffic is translated.

Real-world example

How this comes up in practice

A small business has 20 workstations on the 192.168.1.0/24 network and one public IP from its ISP. The router uses PAT (NAT overload) so all 20 devices share one public address using different source ports. NAT questions test whether you understand the four address terms and which direction each translation applies.

What to study next

Got this wrong? Here's your next step.

Review the four NAT address types (inside local, inside global, outside local, outside global), PAT port overload, and static vs dynamic NAT use cases. Then practise related 1Z0-811 NAT questions on configuration and troubleshooting.

Related practice questions

Related 1Z0-811 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free 1Z0-811 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this 1Z0-811 question test?

What is Java — This question tests What is Java — Static NAT maps one inside address to one outside address..

What is the correct answer to this question?

The correct answer is: The module com.thirdparty.lib does not export the package containing the required class in its module-info.java. — In modular Java, a module must export a package for its classes to be accessible by other modules. If com.thirdparty.lib does not export the package containing the required class, that class will not be found at runtime, even though the module is present. This is a common issue when migrating from classpath-based to module-path-based applications. Option A is correct because the module's exports directive is missing. Option B is incorrect because module path order does not affect accessibility of exported packages; it affects module resolution, but the module is resolved. Option C is incorrect because version conflicts typically cause different errors (e.g., NoSuchMethodError). Option D is incorrect because if the library were incompatible, compilation would likely fail or errors would be different.

What should I do if I get this 1Z0-811 question wrong?

Review the four NAT address types (inside local, inside global, outside local, outside global), PAT port overload, and static vs dynamic NAT use cases. Then practise related 1Z0-811 NAT questions on configuration and troubleshooting.

Are there clue words in this question I should notice?

Yes — watch for: "most likely". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.

What is the key concept behind this question?

Static NAT maps one inside address to one outside address.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 23, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This 1Z0-811 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-811 exam.