Chapter 12. Tiger: JDK 1.5

A major source of debate in the Java community is whether the new release of the JDK, called “Tiger,” should instead be called JDK 2.0. In many ways, Tiger represents a fundamental improvement in the Java language that hasn’t been seen since the emergence of the Java Foundation Classes (JFC).

In addition to offering bug fixes and new classes, Tiger offers several new language features and an implementation of parameterized types called generics. The concept of generics brings Java collections into the world of strong typing and is one of the most conspicuous components missing from JDK 1.4. Generics will be covered later in the chapter; first, we will tackle the new language features.

Warning

Before you read on, note that the information presented in this chapter is in a state of flux. As of this writing, the information is current. However, the process of defining Tiger is still ongoing, and updates or changes may have been implemented between the writing and publication of this book.

New Language Features

Tiger has several new language features designed to eradicate some of Java’s annoyances. Many of these features are borrowed from other languages such as Python or Perl, so if you have experience with these languages, these new features should be familiar to you. However, there are idiosyncrasies of these features that Python and Perl users may not be familiar with.

For Each

One useful feature of Tiger is the new for-each syntax. The purpose of this syntax ...

Get Hardcore Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.