An important feature introduced in Java 9 is Module. By using a module, we can divide the code into smaller components called modules. It means each module has its own responsibility and declare its dependency on other modules to work correctly.
Below are the steps to create a modular project in Java 9:
Initially, we can create a file named "module-info.java" and add to a package(module) for which it is created. For instance, if our package name is com.mycompany.mypackage then the file goes to the same package (src/com.mycompany.mypackage/module-info.java). We can create a module by declaring "exports" and "requires" expressions.
If our modules require another module we can write below code
module com.tutorialspoint.greetings { requires org.tutorix; }
To expose module contents, we can write below code
module org.tutorix { exports org.tutorix; }