Skip to content
Sharp

Project Structure · interview question

Why is it important to have strong encapsulation in a module system like JPMS?

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

Correct answer

A. To prevent unauthorized access to internal APIs.

Why

Strong encapsulation prevents unauthorized access to internal APIs, reducing the risk of misuse and improving maintainability by clearly defining the module's public interface.

Test yourself on Project Structure

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

Start free test
All Project Structure questions →