How does Java decide when to import?

There is an implicit import of java.lang.*.

From the Java specification:

A compilation unit automatically has access to all types declared in its package and also automatically imports all of the public types declared in the predefined package java.lang.

Leave a Comment