7.10. Packages, Classpath, and JAR Archives
Java lets you group class libraries into separate modules or “packages” to avoid naming conflicts and to simplify their handling. For instance, in a real project, the Ship and Shape class hierarchies would have been easier to create and use if placed in separate packages. To create a package called packagename, first make a subdirectory with the same name and place all source files there. Each of these files should contain
as the first noncomment line. Files that lack a package declaration are automatically placed in an unnamed package. Files in the main directory that want to use the package should include
before the ...