Java Reference
In-Depth Information
In many cases, the new EoD features are all about syntax shortcuts that greatly
reduce the amount of code that must be entered, making coding faster and more error-
free. Some features enable improved compile-time type checking, thus producing fewer
runtime errors.
Monitoring and manageability - The 5.0 release includes the ability to remotely
monitor and even manage a running Java application. For example, it is now much
easier to watch memory usage and detect and respond to a low-memory condition.
Many of these features are built right in to the system, and you can add additional
monitoring and managing features to your own code.
Improved desktop client - The last great theme of the 5.0 release was an improved expe-
rience on the desktop client. In addition to better performance because of a faster startup
time and smaller memory footprint, there is a new, improved Swing (see Chapter 6)
look and feel called Ocean, and a new easy-to-customize skinnable look and feel called
Synth in which you can use XML configuration files to specify the appearance of every
visual component in the system. In addition, the GTK and XP look and feels intro-
duced in J2SE 1.4.2 have received further improvements. There is support for OpenGL
and better performance on Unix X11 platforms. The Java Web Start and Java Plug-In
technologies (both used to run Java applications downloaded over the Web) have been
improved.
Other new features in J2SE 5.0 include core XML support, improvements to
Unicode, improvements to Java's database connectivity package known as JDBC,
and an improved, high-compression format for JAR files that can greatly reduce
download times for applets and other networked applications.
1.9.2 Major Ease of Development changes in J2SE 5.0
We list below the most important of the many EoD improvements in Java 5.0,
roughly in the order in which they are encountered in the rest of this topic, not in
the order of importance. Most of these enhancements to the language can only
be appreciated after having had experience with programming in Java. If you are
completely new to Java, you might want to skip this section and come back to it
after you complete Part I.
Autoboxing and unboxing - Chapter 2 explains that Java has primitive types like
int for integers, and Chapter 3 explains “object” types like Integer . The difference
between the two types is very important as we will see. Previous versions of Java made
it necessary to explicitly convert between the primitive types and the object types. In
Chapter 3 we examine the so-called autoboxing and unboxing feature added with J2SE
5.0 that removes the need for explicit conversions in most cases, and thus improves code
readability and removes boilerplate code and sources of errors.
Enhanced for loop - Chapter 2 looks at the several types of looping structures in the
Java language, one of which is the for loop (quite similar to the C/C ++ for loop).
Version 5.0 includes an enhanced for loop syntax that reduces code complexity and
Search WWH ::




Custom Search