I've observed that in the JShell session, not only package "java.lang", but quite a few other packages (that are not imported automatically in the Java class files, e.g. LinkedList
, Math
and several other types) seem to be imported, by default.
I wonder, what other packages are available, by default, in the JShell session, and what motivates this distinction from the normal class files?
I could not find anything on JEP 222, neither the motivation of this auto/implicit import , nor the documentation of - what is actually imported.
You can run
/import
to find out:https://docs.oracle.com/en/java/javase/11/tools/jshell.html