CREATING PACKAGES
Creating our own package involved the following stapes -
1. Declare the package at the beginning of a file using form-Package package name;
2. Define the class that is to be put in the package and declare it public.
3. Create a sub directory under directory where the main source files are stores.
4. Store the listing as the class name .java file in the sub directory created.
5. Compile the file. This creates class file in the sub directory.
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment