Class 1, Part 2 |
Intro to Java 30-IT-396 |
|
More About Packages
-
To put your class in a package, you must:
-
Save the class in the appropriate directory structure.
-
The first non-commented line of the class must be package packagename;
-
Forte' makes it easy. You can use New-Package, and it will pretty
much do the dirty work for you.
-
Make sure your packages are in the classpath when used. Or, if running
from the command line, you can specify the classpath with the -classpath
option.
-
Access modifiers:
-
public: can be used by any class.
-
private: can only be used by the current class.
-
nothing: defaults to friendly, which means that only classes in
the current package can access it.
Comments


Created by: Brandan
Jones January 4, 2002