Tuesday, May 11, 2004

Java 1.5

Overview of several new features of Java 1.5 (tiger) : for, autoboxing, generics and enumerations.

There is a new for construct to iterate over collections of things. For each element in this collect, array, etc, perform these commands. Finally, a truly useful improvement.

Autoboxing allow for conversion to primitives to their Object siblings: itn to Integer for exmaple.

Generics is a feature that has long been missing from Java. Similar to C++ templates, the seem to be better implemented in Java. Caveat: The collections interface also supports the old, non-generic class and so allows you to "break" generics if you want.

Enumerations are good, better that their C/C++ counterpart. They make real object.

0 Comments:

Post a Comment

<< Home