You can create the . class files of all the Java classes and interfaces related to each other in one folder automatically by declaring them under same package. A package is nothing but a directory storing classes and interfaces of a particular concept .