Using Java packages
One conveniently uses files in a package by inserting
at the beginning of a file that needs classes from the mill package
- Then classes in the mill package can be refered to by just using their Classname
- ithout the import command, one must explicitly say mill.Classname
Packages can be grouped hierarchically, with the corresponding directory tree. For example, the mill package could be a subpackage of agriculture. Then a class is referred to as agriculture.mill.Classname.
Except for classes provided with the Java language, a class that is imported or used must either be in the current directory or be accessible to the compiler through the CLASSPATH environment variable.