x
Loading
 Loading
Hello, Guest | Login | Register

A Fresh Cup of Java

Version 1.5 of the Java platform, code named “Tiger,” adds seven new features to the Java programming language. The unifying theme of these features is ease of development: make programs clearer, shorter, and safer, without sacrificing compatibility or compromising the spirit of the language.

Version 1.5 of the Java platform, code-named “Tiger,” adds seven new features to the Java programming language. Designed to complement one another, the unifying theme of the new features is ease of development: make programs clearer, shorter, and safer, without sacrificing compatibility or compromising the spirit of the language.

Loosely speaking, the new features of Java 1.5 provide linguistic support for common idioms, shifting the responsibility for writing boilerplate code from programmers to the compiler. Freed from boilerplate, code is easier to write, read, and maintain. And because the compiler is far less likely to err than programmers, the code is less likely to contain bugs.

Here’s what each feature does in a nutshell:

* Generics provide compile-time type safety for collections and eliminate the drudgery of casting. The result: stronger typing with less typing.

* A new for-each loop eliminates the toil and error-prone nature of using iterators and index variables in loops.

* Autoboxing/unboxing eliminates the travails of conversion between primitive types (such as int) and wrapper types (such as Integer).

* Enums provide a simple, powerful mechanism for representing enumerated types, such as the days of the week or suits of playing cards.

* Varargs let you pass a variable number of parameters to a method, without the usual effort of storing them in an array.

* Static import lets you avoid the drudgery of qualifying static members with class names without abusing interface inheritance.

* Metadata lets you avoid writing boilerplate…

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?
Read More
  1. Helpful Tools for Software Developers
  2. The Github Hall of Fame
  3. Book'em, Github.
  4. This Week on Github: Stupid Ruby Tricks
  5. A Veritable Scatter Shot!
Follow Linux Magazine
Rackspace