# Java: Directories and Files

## Put all source files into a directory

Whenever you start a new project, create a new directory for the source files. The directory name should be lowercase letters, with no blanks or other puctuation.

Multiple classes of larger programs are usually grouped together into packages. See Packages - Defining for how and why to use packages.

## One class per file

Put each class in its own separate source file. Each source file must be named exactly the same as the class, plus a ".java" suffix. For example, if the class is named "Test", the file must be named "Test.java" (and not "test.java").

It's possible to put more than one class in a file and have everything work. I did this for a long time for small programs, have given it up because it doesn't scale up as you create larger programs and development tools. IDEs like NetBeans require each class to be in a separate source file. Also, a very common development tool, Ant, works best when each class is in its own source file.