Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Welcome to the first of a three-part series on Sun Microsystems' latest release of the Java 2 Platform, Standard Edition (J2SE). J2SE 1.5—code-named Tiger—is the most significant revision to the Java language since its origination. With version 1.5, Java has been extended with several new features, and my goal with this series is to introduce you to the most important features.
Each article presents a detailed discussion of a handful of distinct features and provides practical examples of how they can be used in the real world. Part 1 is a quick introduction to J2SE 1.5 and covers many new additions. Part 2 will be devoted to generics, Java's counterpart to templates in C++ and a similar facility (also called generics) in C# 2.0. Part 3 focuses exclusively on J2SE 1.5's new metadata facility called annotations, which allow programmers to decorate Java code with their own attributes. These custom attributes can be used for code documentation, code generation, and, during runtime, to provide special services such as enhanced business-level security or special business logic.
Read the whole series: "Taming Tiger," Tarak Modi (JavaWorld):
As I mentioned before, J2SE 1.5 represents the largest overhaul of Java since its inception and contains many new and exciting
features. The additions provide developers with a host of new capabilities. For example, the addition of enumerations and
generics provides Java with compile-time type safety. That means programming or logic errors are caught during program compilation
instead of during runtime. This may not seem to be a great benefit on the surface, especially for smaller projects. However,
as your code's complexity increases and your project grows larger, it becomes more likely that parts of a program may not
have been unit tested (I know this never happens on your project!), and after three months of smooth sailing in production,
you answer a call at 2 a.m. that informs you of a java.lang.ClassCastException. Compile-time type safety catches all these errors during program compilation.
In this article, I discuss some of the new language features introduced in J2SE 1.5, including autoboxing and unboxing of
primitives, the enhanced for loop, variable method arguments (varargs), the much anticipated enumerations, static imports, and the new formatted input method printf (a concept borrowed from C and C++).
All of these features are part of Java Specification Request 201. Without further ado, let's start with the first feature—autoboxing and unboxing.
Consider the following code fragment:
Archived Discussions (Read only)
(