| Java FAQ | ||
| JSP FAQ | ||
| Servlet FAQ | ||
XyzWs Java FAQ:
What is a Java package?
Printer-friendly version |
Mail this to a friend
|
Advertisement
|
What is a Java package?A Java package is a mechanism for organizing a set of related classes and interfaces into namespaces. Because software written in the Java programming language can be composed of hundreds or thousands of individual classes and interfaces, it makes sense to keep things organized by placing related classes and interfaces into packages.
Java source files belonging to the same category or providing similar
functionality can include a Java packages can be stored in compressed files called JAR files. A JAR file can maintain its own directory structure, and Java follows exactly the same rules as for searching in ordinary directories. Specifically, `directory name = package name'.
The Java platform provides an enormous class library (a set of packages)
suitable for use in your own applications. This library is known as the
"Application Programming Interface", or "API" for short. Its packages represent
the tasks most commonly associated with general-purpose programming. For
example, a |