Java 9 Module

The collection of packages and code into a single unit is called module . The module can be described with the help of module descriptor which is named by module-info.java and the module declarator describes the below three that were shown in the image.

Name of the module

The name of the module is named on the basis on the reverse domain pattern. It is mainly used to overcome the naming conflict in java. suppose we have the domain names as w3wiki.org the module name can be org.w3wiki .

The next point is that it should contain what does the module contains and what does the module export in the java

Java Modules

Java Module System provides an additional layer of encapsulation to our programs as we can specify which package can be utilized by the modules, and which modules could have entry to to them. Before entering into the exclusive types of modules in Java, we will first learn the differences among applications and modules. We recognize that there are numerous applications in Java including IO bundle, AWT package, swing bundle, and so on.

Similar Reads

Difference Between Module and Package

The principal difference between the module and package is given below....

Java 9 Module System

Java 9 has one of the major changes in its features which is the Java module System. The main aim of the system is to collect Java packages and code to be collected into a single unit called a Module. The reason to add this feature in Java is that when we want to create modular applications using Java the earlier versions before 9 have no system like this that’s why the size of the application has increased. Even the JDK file in the earlier version of Java has a large size only the rt.jar file size was around 64 MB....

Java 9 Module

The collection of packages and code into a single unit is called module . The module can be described with the help of module descriptor which is named by module-info.java and the module declarator describes the below three that were shown in the image....

How to Create a module in java?

Earlier we supposed that our java module name is org.geeksforgeeks which has followed the reverse domain pattern to overcome the naming conflicts....

Contact Us