THE Java™ Programming Language, Fourth Edition

(Jeff_L) #1

The Java™ 2 Platform Standard Edition comes with many standard packages. These packages, all subpackages
of the root java package, define the main classes and interfaces for the platform. Throughout this book we
have taught you about many of these classes, particularly those relating to the core language and those most
commonly used in general programs. The main packages that we have covered are


java.lang The main language classes, such as Object, String, Thread, Class, and so on.
The subpackage java.lang.annotation defines some annotation types and was covered in
Chapter 15. The subpackage java.lang.reflect provides a way to examine types in detail and
was covered in Chapter 16. The subpackage java.lang.ref defines the weak reference types that
allow you to influence garbage collection and was covered in Chapter 17.


java.io Input and output and some file system manipulation. This package was covered
extensively in Chapter 20.


java.util Classes of general utility. Defines the collection classes both new and legacy that were
covered in Chapter 21 and the localization classes covered in Chapter 24. Miscellaneous utilities were
covered in Chapter 22.



  • java.util.regex Classes for regular expressions. These were covered in Chapter 13.
    java.security The platform security classes, which were briefly described in Chapter 23. It
    contains a number of other classes for encryption, authentication, digital signatures, and other useful
    security-related code.



java.text Internationalization and localization for formatting and parsing numbers and dates,
sorting strings, and message lookup by key. These were touched on briefly in Chapter 24.


We mentioned these main packages briefly, without covering them in detail:


java.nio The "New I/O" classes that we briefly introduced at the end of Chapter 20. The
CharBuffer class from this package also pops up in a couple of other places.


java.nio.charset Classes for defining character sets and their encodings. This package was
briefly covered in Chapter 13.


java.util.concurrent Contains (amongst other things) the concurrent collections that were
briefly discussed in Chapter 21.


In addition, there are main packages we haven't covered at all:


java.awt The Abstract Window Toolkit abstraction layer for writing platform-independent
graphical user interfaces.


java.applet The Applet class and related types for writing subprograms that can be hosted
inside other applications, such as HTML browsers.



  • java.beans The JavaBeans components for user-composable code.
    java.lang.instrument Services for defining agents that can instrument applications running
    on a virtual machine.



java.lang.management Services for monitoring and managing both the virtual machine and the
operating system on which it runs.


java.math Mathematical manipulations. Currently, this package has only three classes, which
handle some kinds of arbitrary-precision arithmetic.



  • java.net Networking classes for sockets, URLs, and so on.
    java.rmi Remote Method Invocation, with which you can invoke methods on objects running in
    other virtual machines, typically across a network.




  • java.sql The JDBC package for using relational databases.
    java.util.jar Classes for reading and writing JAR (Java ARchive) files. These archive files can
    be used to distribute packages of related classes and resources, as covered in "Package Objects and
    Specifications" on page 477.




  • java.util.logging A framework for logging from within your code.
    java.util.prefs Provides a mechanism for managing user and system preferences, as well as
    application configuration.


Free download pdf