J.IX · Java 25 practice question
How does Java 25 change the default imports provided automatically by the JShell tool?
Check answer and explanation
Correct answer: JShell automatically imports module java.base instead of an ad-hoc list of ten packages
Explanation
In Java 25, JShell replaces its previous ad-hoc list of ten on-demand package imports by automatically importing module java.base.
Common trap
JShell continues to provide automatic imports for convenience; it simply switches from ten specific packages to module java.base. Only module java.base is automatically imported, not every module on the module path.
Source: JEP 511: Module Import Declarations — Description
Checked against the cited text on 2026-11-25.