Home >Java >javaTutorial >What are the different module types in Java 9?
Module system is a new feature introduced in Java 9. A module is a set of packages , divided into two types: exported packages and hidden packages . Export packages can be used outside this module. Hidden packages cannot be used outside this module; only the code of this module can use these packages.
There are four types of modules in Java 9, as follows:
<strong>module <Module-Name> { requires moduleName; exports packageName; }</strong>
The above is the detailed content of What are the different module types in Java 9?. For more information, please follow other related articles on the PHP Chinese website!