For a synopsis of java.lang and java.util enhancements, refer to the documentation at http://java.sun.com/j2se/1.5.0/docs/guide/lang/enhancements.html.
For a synopsis of added networking features, refer to the documentation at http://java.sun.com/j2se/1.5.0/docs/guide/net/enhancements-1.5.0.html.
This release of J2SE offers significant enhancements for security. It provides better support for security tokens, support for more security standards (SASL, OCSP, TSP), improvements for scalability (SSLEngine) and performance, plus many enhancements in the crypto and Java GSS areas. For details see the documentation at http://java.sun.com/j2se/1.5.0/docs/guide/security/index.html.
Enhancements are as follows:
Character handling is now based on version 4.0 of the Unicode standard. This affects the Character and String classes in the java.lang package, the collation and bidirectional text analysis functionality in the java.text package, character classes in the java.util.regex package, and many other parts of the J2SE. As part of this upgrade, support for supplementary characters has been specified by the JSR 204 expert group and implemented throughout the J2SE. See the article Supplementary Characters in the Java Platform, the Java Specification Request 204, and the Character class documentation for more information.
The DecimalFormat class has been enhanced to format and parse BigDecimal and BigInteger values without loss of precision. Formatting of such values is enhanced automatically; parsing into BigDecimal needs to be enabled using the setParseBigDecimal method.
Vietnamese is now supported in all locale sensitive functionality in the java.util and java.text packages. See the Supported Locales document for complete information on supported locales and writing systems.
Refer also to the documentation at http://java.sun.com/j2se/1.5.0/docs/guide/intl/index.html.
The System.getenv(String) method is no longer deprecated. The new System.getenv() method allows access to the process environment as a Map<String,String>. Refer to the documentation at http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#getenv(java.lang.String).
The new ProcessBuilder class provides a more convenient way to invoke subprocesses than does Runtime.exec. In particular, ProcessBuilder makes it easy to start a subprocess with a modified process environment (that is, one based on the parent's process environment, but with a few changes). Refer also to the documentation at http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ProcessBuilder.html.
An interpreter for printf-style format strings, the Formatter class provides support for layout justification and alignment, common formats for numeric, string, and date/time data, and locale-specific output. Common Java types such as byte, java.math.BigDecimal , and java.util.Calendar are supported. Limited formatting customization for arbitrary user types is provided through the java.util.Formattable interface.
Refer to the documentation at http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html.
The java.util.Scanner class can be used to convert text into primitives or Strings. Since it is based on the java.util.regex package, it also offers a way to conduct regular expression based searches on streams, file data, strings, or implementors of the Readable interface. Refer to the documentation at http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html.
Support for generics, annotations, enums, and convenience methods has been added. Also, java.lang.Class has been generified. Refer to the documentation at http://java.sun.com/j2se/1.5.0/docs/guide/reflection/enhancements.html.
A subclass of PropertyChangeEvent called IndexedPropertyChangeEvent has been added to support bound properties that use an index to identify the part of the bean that changed. Also, methods have been added to the PropertyChangeSupport class to support firing indexed property change events. Refer to the documentation at http://java.sun.com/j2se/1.5.0/docs/guide/beans/index.html.
The Collections Framework has been enhanced in the following ways:
Three new language features are targeted at collections: Generics, Enhanced for Loop, and Autoboxing.
Three new interfaces have been added to the framework (two of which are part of java.util.concurrent): Queue, BlockingQueue, and ConcurrentMap.
Two concrete implementations of Queue have been added, as well as one skeletal implementation.
Five blocking queue implementations have been added, and one ConcurrentMap implementation.
Special-purpose Map and Set implementations are provided for use with typesafe enums.
Special-purpose copy-on-write List and Set implementations have been added.
Wrapper implementations are provided to add dynamic type-safety for most collection interfaces.
Several new algorithms are provided for manipulating collections.
Methods are provided to compute hash codes and string representations for arrays.
Refer to the documentation at http://java.sun.com/j2se/1.5.0/docs/guide/collections/index.html.
For details refer to JSR 206 or to the documentation at http://java.sun.com/j2se/1.5.0/docs/guide/xml/jaxp/index.html.
The wrapper classes (Integer, Long, Short, Byte, and Char) now support common bit manipulation operations which include highestOneBit, lowestOneBit, numberOfLeadingZeros, numberOfTrailingZeros, bitCount, rotateLeft, rotateRight, reverse, signum, and reverseBytes.
The numerical functionality provided by the libraries has been augmented in several ways:
The BigDecimal class has added support for fixed-precision floating-point computation. Refer to JSR 13.
The Math and StrictMath libraries include hyperbolic transcendental functions (sinh, cosh, tanh), cube root, base 10 logarithm, etc.
Hexadecimal floating-point support - To allow precise and predictable specification of particular floating-point values, hexadecimal notation can be used for floating-point literals and for string to floating-point conversion methods in Float and Double.
Refer to the documentation at http://java.sun.com/j2se/1.5.0/docs/guide/math/index.html.
The new java.lang.instrument package provides services that allow Java programming agents to instrument programs running on the Java virtual machine. The intrumentation mechanism is modification of the bytecodes of methods.
Support has been added to handle enumerated types which are new in version 1.5.0. The rules for serializing an enum instance differ from those for serializing an ordinary serializable object: the serialized form of an enum instance consists only of its enum constant name, along with information identifying its base enum type. Deserialization behavior differs as well--the class information is used to find the appropriate enum class, and the Enum.valueOf method is called with that class and the received constant name in order to obtain the enum constant to return.
Refer to the documentation at http://java.sun.com/j2se/1.5.0/docs/guide/serialization/index.html.
The java.util.concurrent, java.util.concurrent.atomic, and java.util.concurrent.locks packages provide a powerful, extensible framework of high-performance, scalable, thread-safe building blocks for developing concurrent classes and applications, including thread pools, thread-safe collections, semaphores, a task scheduling framework, task synchronization utilities, atomic variables, and locks. The addition of these packages to the core class library frees the programmer from the need to craft these utilities by hand, in much the same manner that the Collections Framework did for data structures. Additionally, these packages provide low-level primitives for advanced concurrent programming which take advantage of concurrency support provided by the processor, enabling programmers to implement high-performance, highly scalable concurrent algorithms in the Java language to a degree not previously possible without resorting to native code.
Refer to JSR 166 and to the documentation at http://java.sun.com/j2se/1.5.0/docs/guide/concurrency/index.html.
The java.lang.Thread class has the following enhancements:
Thread priority handling has changed; see the above link for details.
Thread.State enum class and the new getState() API are provided for querying the execution state of a thread.
The new thread dump API - the getStackTrace and getAllStackTraces methods in the Thread class - provides a programmatic way to obtain the stack trace of a thread or all threads.
The uncaughtExceptionHandler mechanism, previously available only through the ThreadGroup class, is now available directly through the Thread class.
A new form of the sleep() method is provided which allows for sleep times smaller than one millisecond.
This release of J2SE offers significant enhancements for monitoring and management for the Java platform.
Monitoring and management API for the Java virtual machine The new java.lang.management package provides the interface for monitoring and managing the Java virtual machine.
Monitoring and management API for the logging facility The new java.util.logging.LoggingMXBean interface is the management interface for the logging facility.
JMX instrumentation of the Java virtual machine The Java virtual machine (JVM) has built-in instrumentation that enables you to monitor and manage it using JMX. You can easily start a JMX agent for monitoring and managing remote or local Java VMs instrumentation or of any application with JMX instrumentation. See Monitoring and Management Using JMX at http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html for details.
The SNMP agent publishes the standard MIB for the Java virtual machine instrumentation as defined by JSR 163. For more information, see SNMP Monitoring and Management.
JavaTM Management Extensions JMXTM API version 1.2 and the RMI connector of the JMX Remote API version 1.0 are included in J2SE 5 release. The JMX API allows you to instrument libraries and applications for monitoring and management. The RMI connector allows this instrumentation to be remotely accessible. For more details, see the JMX documentation at http://java.sun.com/j2se/1.5.0/docs/guide/management/index.html.