
- Java Tutorial
- Java - Home
- Java - Overview
- Java - Environment Setup
- Java - Basic Syntax
- Java - Object & Classes
- Java - Constructors
- Java - Basic Datatypes
- Java - Variable Types
- Java - Modifier Types
- Java - Basic Operators
- Java - Loop Control
- Java - Decision Making
- Java - Numbers
- Java - Characters
- Java - Strings
- Java - Arrays
- Java - Date & Time
- Java - Regular Expressions
- Java - Methods
- Java - Files and I/O
- Java - Exceptions
- Java - Inner classes
- Java Object Oriented
- Java - Inheritance
- Java - Overriding
- Java - Polymorphism
- Java - Abstraction
- Java - Encapsulation
- Java - Interfaces
- Java - Packages
- Java Advanced
- Java - Data Structures
- Java - Collections
- Java - Generics
- Java - Serialization
- Java - Networking
- Java - Sending Email
- Java - Multithreading
- Java - Applet Basics
- Java - Documentation
- Java Useful Resources
- Java - Questions and Answers
- Java - Quick Guide
- Java - Useful Resources
- Java - Discussion
- Java - Examples
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 and divided into two types: Exported packages and Concealed packages. Exported packages can be used outside of this package. Concealed packages can't be used outside of this module, only the code of this module can use these packages.
There are four types of modules in Java 9 listed below
- Application Modules: This module has been created to achieve functionality. All third-party dependencies belong to this category.
- Automated Modules: The jars that can be placed in a module path without module descriptors belong to automated modules. The main benefit of this module is to use pre-Java 9 build jars.
- Unnamed Modules: Any jar or class on the classpath belongs to the unnamed module. Since it doesn't have any name, it can read and export all the modules.
- Platform Modules: The JDK has been transformed into a modular structure, these are called platform modules.
module <Module-Name> { requires moduleName; exports packageName; }
- Related Articles
- What are the different compilation modes of a module in Java 9?
- What are the different "/types" commands in JShell in Java 9?
- What are the characteristics of a module in Java 9?
- What are the benefits of a module in Java 9?
- What are the components in a module-info file in Java 9?
- What is Module System in Java 9?
- What are the different types of keywords in Java?
- What are the different types of classes in Java?
- What are the advantages and disadvantages of the Module System in Java 9?
- What is an unnamed module in Java 9?
- What are the different shortcut keys in JShell in Java 9?
- What are the different feedback modes in JShell in Java 9?
- What are the different "/vars" commands in JShell in Java 9?
- What are the different "/edit" commands in JShell in Java 9?
- What are the different startup scripts in JShell in Java 9?

Advertisements