Under Eclipse, the package, source folder, and folder are all directories.
Their differences are as follows:
Package: When you build a package, it builds itself into the source folder, and it can only be built under it.
SOURCE folder: The directory where the Java source code is stored, and of course includes some package directories, and can include other files as well.
After the project is built, Java itself in source folder is compiled into a class file to the corresponding/web-inf/classes folder, and the other files are moved to the corresponding folder in/web-inf/classes.
Package and Sourcefolder comparisonsimilarly: The package can include other files in addition to the Java file, and the compiled, packaged file path has the same rules as the file path under the source folderDifferent:1.sourceFolder by "/" to the division, the package by "." To divide the hierarchy. 2.source folder can be built under the package, but the package cannot be built under the source folder The package attribute in the 3.java file is assigned according to the path of the bag, the source folder path is not assigned to the package property of the Java file, and then the second is different to get the conclusion, all source The package property of the Java file under folder is empty.
folder: It can be placed in whatever file. Contains Java source files, jar files, other files (such as pictures, sounds, etc.). Here I explain, If it contains Java source files, regardless of whether the program is correct, Eclipse will not give an error, and treat them as ordinary files. But the project assumes that the files in this case are different.
package,source Folder,folder between each other
Package turns into folder display: Select Package, Build path-> Exclude
Folder turns into package display: Select folder, Build path-> Include
Package turns to source folder display: Select Package, build path-> use as source folder
source folder turns into package display: Select folder, Build path-> Remove from BuildPath
conversion of Pacage to source folder ibid.
Eclipse Package,source Folder,folder Differences and mutual conversions