1. Package: It is essentially a folder.
2. The package uses "." to indicate the hierarchical relationship. For example, the directory represented by p1.p2.Test is \p1\p2\Test.class.
Create a new package in the idea:
name it: com.miao.entity
and display it in the folder like this:
Create a new class Person under the com.miao.entity folder:
the arrow points to the declaration of the package, indicating the current class , belonging to the entity package:
Then create a new package: com.miao.dao
found under the folder:
Then create a new Java class under dao named Testperson
and create a Person object under the folder:
you can see the error A:
Because there is no import of Person:
the import package is: ALT+Enter
Then just fine: