Modules

suggest change

Versions

Java SE 9. The requires public form below is early-access syntax; the directive that shipped is requires transitive.

Syntax

Remarks

The use of modules is encouraged but not required. This allows existing code to continue working in Java 9. It also allows for a gradual transition to modular code.

Code that is not in a named module is placed in the unnamed module when it is compiled and when it runs. This module can use types from every other module, but only from packages that have an exports declaration.

All packages in the unnamed module are exported automatically.

Keywords, e.g. module, are restricted inside the module declaration but can continue to be used as identifiers elsewhere.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents