module
A named set of packages with a descriptor, module-info.java, that declares what it requires, exports, opens, uses and provides.
In more detail
A module reads only the modules it requires, and other modules can use only the packages it exports. opens allows deep reflection at run time. Every module reads java.base without saying so.
Example
module com.shop.impl {
requires transitive com.shop.api;
provides com.shop.api.Pricing with com.shop.impl.internal.SalePricing;
}Related terms
- automatic module — A plain jar placed on the module path, given a module name derived from its manifest or file name.
- unnamed module — The module that holds every class loaded from the class path.
- module path — The list of directories and jars where the compiler and the launcher look for modules.
Taught in
- Fifty Items, Five Traps — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- A Hundred And Twenty Minutes, Fifty Items — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Sealed Types, Casts And Pattern Matching — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Modules: Exports, Opens And Services — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Jars, Automatic Modules And Runtime Images — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Sprint: Modules And Concurrency — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Sprint: I/O And Localization — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Mock Exam: Sit It, Score It — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep