|Lesson 4||Packaging Java classes |
|Objective||Organize Java Classes into Packages|
Organize Java Classes into Packages
statement is used to identify the package
to which a class belongs.
This statement must be placed at the beginning of the source code file for the class. Following is an example of a
Placed at the beginning of a source code file for a class, this statement indicates that the class belongs to the
If you wanted to include classes named
slinky in the
toys package, you would place the above
package statement at the top of the source code files for each class.
Even though the
package statement must be placed at the beginning of a source file, it is okay to have comments appearing before it in the code.
Java Classes - Quiz