- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are the advantages of Modules in Java 9?
A module is a container of packages designed for reuse, and each module contains a module descriptor that includes the information about module name, module dependencies (name of the other modules which it depends on) and name of the packages it exports that can be used only by modules which depend on it.
Advantages of Modules
- Strong encapsulation is one of the major advantages of a module system as the “public” access specifier is no longer accessible to everyone. By using a module system, we can able to allow a limited set of packages to be accessible to outside applications.
- It makes our application lightweight, so it can be run on more number of devices. As it is lightweight, it improves the performance of an application.
- An architecture that allows us to split our application into external and concealed packages, hence easy to follow separation of concern principle.
- Some internal classes in packages, for instance, sun.security.*, com.sun.crypto.* is no longer accessible as these packages are now concealed, therefore improves security.
A module can be declared inside the file named "module-info.java", which is the module descriptor.
module com.tutorialspoint.app{ // Modules upon which the module "com.tutorialspoint.app" depends on requires com.tutorialspoint.services; // Packages exposed by this module that can be used by other modules exports com.tutorialspoint.app.util; }
- Related Articles
- What are automatic modules in Java 9?
- What are the advantages and disadvantages of the Module System in Java 9?
- What are the advantages of private methods in an interface in Java 9?
- Advantages of using Loadable Kernel Modules
- What are the advantages of Lambda Expressions in Java?
- What are modules in JavaScript?
- How can we display all modules with classloaders in Java 9?
- What are the modules of Triple DES Algorithm?
- What are the advantages of CSS?
- What are the advantages of JavaScript?
- What are the advantages of coal?
- What are the advantages of food?
- What are the advantages of SIEM?
- What are the advantages of LPG?
- What are the advantages of nylon ?

Advertisements