Skip to content
Sharp

Project Structure · interview question

How does the 'requires transitive' keyword in module-info.java affect module dependencies?

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

Correct answer

B. It makes the required module's dependencies available to modules requiring the current module.

Why

The 'requires transitive' keyword means that any module that requires the current module will also implicitly require the modules specified as 'transitive', allowing indirect access to their public types.

Test yourself on Project Structure

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

Start free test
All Project Structure questions →