Subsections
- Packages have members that are related classes, interfaces, and subpackages.
- Packages are useful for several reasons:
- Packages create a grouping for related interfaces and classes.
- Interfaces and classes in a package can use popular public names that make sense in one context but might conflict with the same name in another package.
- Packages can have types and members that are available only within the package.
- A public class or interface is accessible to code outside that package.
- Types that are not public have package scope; they are available to all other code in the same package, but are hidden outside the package and even from code in nested packages.
- Package scope is the default if public/protected/private are not declared.
- Contain functionally-related classes and interfaces.
- Classes in a package can freely access each other's non-private members.
- Should provide logical groupings for programmers looking for useful interfaces and classes.
- Packages can be nested inside other packages.
|
|