Packages

A package is a logical grouping of related classes, interfaces, enumerations, annotations, and functions. As source files grow larger, it is necessary to group these files into meaningful and distinct collections for various reasons, such as to enhance the maintainability of applications, name conflict prevention, and access control.

A package is created with the package keyword followed by a package name:

package foo

There can be only one package statement per program file. If a package for a program file is not specified, the contents of the file are placed into the default package.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.71.115