All classes need to be imported before they can be used, except for two cases where they can be used without importing

All classes need to be imported before they can be used, except for two cases where they can be used without importing:

  1. The target class to be used is located in the same package as the current class.

  2. If the target class used is located in the java.lang package, but does not contain the contents of the subpackages under this package.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324400950&siteId=291194637