Skip to content
Sharp

Project Structure · interview question

Why does not specifying the 'requires' directive for a module in JPMS change runtime behavior?

Multiple choiceMediumchapter-10-curatedpremiumproject-structurejava-modules-jpms
Choose one answer
Answer and explanation

Correct answer

B. The module cannot access any other modules.

Why

Without specifying the 'requires' directive, a module cannot access types from other modules, enforcing strict modular boundaries unless explicitly declared.

Test yourself on Project Structure

A free test with instant, explained results. No account needed.

Start free test
All Project Structure questions →