You can organize Java projects in two different ways.
Use the project as the container of packages. In this organization, all
Java packages are created directly inside the project. This is the selected
organization by default. The generated CLASS files are stored along with
the JAVA source files.
Use source folders as the container for packages. In this project organization,
packages are not created directly inside the project but in source folders.
You create source folders as children of the project and create your packages
inside these source folders.
The default organization for new projects can be changed on the preference
pages (Window > Preferences > Java > New Project).