package
You can indicate that classes in a source file belong to a particular package using the package statement.
For example:
1 package shipping.domain;
2
3 //class vehicle of the 'domain' sub-package within the 'shipping' application package.
4 public class Vehicle {
5 .....
6 }
The package declaration if any must be at the begining of he source code .You can precede it white space and comments,but nothing else.
Only one package declaration is permitted and it governs the entire source file .If a Java technology source file does not contain a package declaration then the classes declared in that file belongs to the unnamed (default) package.
pAckage names are hierarchical and are seperated by dots.It is usual for the elements of the packagename to be entirely lower case.
No comments:
Post a Comment