Yes, for a small project it may not make much sense. You could simply:
MyProject | + - FileOne.java + - FileTwo.java + - FileThree.java
But for large projects, you may need to divide into packages classes that relate to different functions.
For example, the main java library has (to name a few)
java.lang (contains main clans such as Object, String, Integer, Boolean, StringBuilder) java.util (contains utility classes such as List, ArrayList, Date, Map, Timer, etc.) java.io (contains classes for Input / Ouput such as File, InputStreamReader, BufferedReader, etc.
java.sql, java.swing, java.text, etc. etc.
This way you “pack together” classes that are related to each other.
The source code for these classes, by convention, in a folder named src
So you will have:
YourProject | + - src | + packageA | + packageB
You may also need to separate the source code from the compiled files, so the classes folder is used by convention. In addition, you may need a separate folder for hosting the libraries of the third part, another for resources, such as images, auxiliary files or others, different for documentation, etc.
Thus, a typical layout might be:
YourProject | + - src/ + - lib/ + - classes/ + - resources/ + - conf/ + - bin/ + - doc/ + - etc/
But, of course, this makes sense only for large projects.
Web applications usually also contain the WEB-INF folder, etc.
If your project contains only a couple of classes, don’t worry and don’t go with one folder, but it’s good to know what the rationale is.