Monday, 30 August 2004
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 languageLoosely 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 code by enabling tools
to generate it from annotations in the source code.
Read Full
Story Only registered users can write comments. Please login or register. Powered by AkoComment 1.0 beta 2! |