The java.lang.* and java.util.* Packages
The java.lang package provides classes that are fundamental to the design of the JavaTM programming language. The java.lang.refs and java.lang.reflect packages provide, respectively, reference-object classes and APIs for obtaining reflective information about classes.
The java.util.* packages provide support for the event model, collections framework, date and time facilities, and contains various utility classes. The java.util.zip and java.util.jar packages provide support for ZIP file format and Java Archive (JAR) file formats respectively, and the java.util.prefs package implements the Preferences API.
Java 2 SDK v1.4 offers several significant enhancements to the functionality in the java.lang.* and java.util.* packages, including
Enhancements in Java 2 SDK v1.3
- Assertion Factility - Assertions are boolean expressions that the programmer believes to be true concerning the state of a computer program. For example, after sorting a list, the programmer might assert that the list is in ascending order. Evaluating assertions at runtime to confirm their validity is one of the most powerful tools for improving code quality, as it quickly uncovers the programmer's misconceptions concerning a program's behavior.
- Preferences API - The preferences API, implemented by package java.util.prefs, allows applications to store and retrieve user and system preference and configuration data. This data is stored persistently in an implementation-dependent backing store. The Preferences API is intended to replace most common uses of class java.util.Properties, rectifying many of its deficiencies, while retaining its light weight.
- Logging API - The Java Logging API facilitates software servicing and maintenance at customer sites by producing log reports suitable for analysis by end users, system administrators, field service engineers, and software development teams. The Logging APIs capture information such as security failures, configuration errors, performance bottlenecks, and/or bugs in the application or platform. The core package includes support for delivering plain text or XML formatted log records to memory, output streams, consoles, files, and sockets. In addition, the logging APIs are capable of interacting with logging services that already exist on the host operating system.
- Regular Expressions - New package java.util.regex contains classes for matching character sequences against patterns specified by regular expressions.
- Chained Exception Facility - This is a new facility that provides a common API to record the fact that one exception caused another, to access causative exceptions, and to acess the entire "causal chain" as part of the standard stack backtrace, ensuring that preexisting programs will provide this information with no additional effort on the part of their authors.
Version 1.3 of the Java 2 SDK offered several enhancements in the java.lang and java.util.* packages. See Enhancements in 1.3 for details.