Why doesn\'t Java need to import classes like Integer, String, etc. while it needs to import other classes?
Classes in the java.lang package do not need to be imported (the compiler acts like they are always imported). This package includes core classes such as String, Enum, Runnable, NullPointerException, and of course, the primitive wrapper classes such as Integer and Double.
java.lang
package is imported by default, no need to explicitly import it.
For the question for "Is java.lang the only one auto-import package?" There is two packages.
you can look up here for more. https://www.quora.com/Which-package-is-available-by-default-in-java