Under Eclipse, Package,source Folder,folder are all folders, and any file can be placed under these three folders.
The differences are as follows:
Package: When you build a package, it is automatically built into the source folder and can only be built under this directory
SOURCE folder: Folders that store Java source code, and of course include some package folders, and can contain other files
After the project is built, the Java inside the Source folder is automatically compiled into a class file into the corresponding/web-inf/classes folder.
Package and source folder comparison
The same: Under the package except the Java file can also contain other files, and the compiled, packaged file path and the file path under the Source folder has the same rule differences: 1.Source folder by "/" to the division, the package depends on "." To the hierarchy (Spring configuration file configuration will be reflected) 2.Source folder can be built under the package, and the package can not be built under the Source folder 3. The package property in the Java file is assigned according to the "package" path, and the source folder path does not take part in the Java file's value assignment, and then the second is different to get the conclusion that all the source folder The Java file package property is empty
Folder: It can be placed in any file. Includes Java source files, jar files, other files (e.g., pictures, sounds, etc.). Here I explain that if there is a Java source file inside, regardless of whether the program is correct, Eclipse will not error, Treat them as ordinary files. But if the project is to use the files in it, the situation will be different.
Eclipse Package,source Folder,folder Differences