Package:
Java provides a mechanism for partitioning the class name space into
more manageable chunks. This mechanism is the package. The package is both a
naming and a visibility control mechanism. You can define classes inside a
package that are not accessible by code outside that package. You can also
define class members that are only exposed to other members of the same
package.
Defining a Package
To create a package is quite easy: simply include a package command as the first statement in a Java source file. Any
classes declared within that file will belong to the specified package. The package statement defines a name space
in which classes are stored. If you omit the package statement, the class names are put into the default
package, which has no name.
This is the general form of the package statement: package pkg;
Here name of the package.
Related Topics
Privacy Policy, Terms and Conditions, DMCA Policy and Compliant
Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.