Content deleted Content added
Removed {{compu-lang-stub}} as I think the article, while not complete, has grown past the stub phase |
Cleaned up intro and other parts--more work still needed, but cleaned up enough that I removed the {{expert}} tag |
||
Line 1:
A '''Java package''' is a [[Java programming language]] mechanism for organizing [[class (computer science)|classes]] into [[namespace]]s. Java [[source file]]s belonging to the same category or providing similar functionality can include a '''<code>package</code>''' statement at the top of the file to designate the package for the classes the source file defines. Java packages can be stored in compressed files called [[JAR file]]s.
* A package provides a unique
* A package facilitates access protection.
* A package can contain the following kinds of [[Datatypes|types]].
** [[Class (computer science)|Classes]]
** [[interface (computer science)|Interfaces]]
** [[Enumeration|Enumerated Types]]
** [[Annotation]]s
== Using packages ==
Line 44 ⟶ 43:
== Package naming conventions ==
In general, a package name begins with the [[top level ___domain]] name of the organization and then the organization's ___domain and then any subdomains listed in reverse order. The organization can then choose a specific name for their pacakge. Package names should be all lowercase characters whenever possible.
For example, if an organization in Canada called MySoft creates a package to deal with fractions,
Complete conventions for disambiguating package names and rules for naming packages when the Internet ___domain name cannot be directly used as a package name are described in [http://java.sun.com/docs/books/jls/third_edition/html/packages.html#7.7 section 7.7] of the
== Core packages in J2SE 5.0 ==
{{main|Java Platform, Standard Edition}}
* {{Javadoc:SE|package=java.lang|java/lang
* {{Javadoc:SE|package=java.util|java/util}}: collection [[data structure]] classes
* {{Javadoc:SE|package=java.math|java/math}}: provides mathematical functions
* {{Javadoc:SE|package=java.io|java/io}}: file operations
|