Qualified exports
In the previous section, we looked at transitive dependencies that let us tweak the readability relationship between modules to handle some special use cases. In this section, you'll be introduced to a way you can tweak the accessibility relationships in some special cases. This can be done using a feature called qualified exports. Let's learn what they are.
You've already learned that the exports keyword lets you specify which packages in a module are allowed to be used outside the module. The exported packages form the public contract of the module, and any module that reads such a module automatically gets accessibility to those exported packages.
But there is a catch here! Ideally, you'd like to design your modules and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access