da: http://zamples.com/JspExplorer/sampl...lesJDK1_5.html

Autoboxing
Java's distinction between primitive types and their equivalent Object types was painful. Fortunately, with the advent of autoboxing, that will become a fading memory.

// automatically convert one type to another
Integer integer = 1;
System.out.println(integer);

// mix Integer and ints in the same expression
int i = integer + 3;
System.out.println(i);


Collections
The collections framework is greatly enhanced by generics, which allows collections to be typesafe.

LinkedList<String> stringList = new LinkedList<String>();
stringList.add("of");
stringList.add("course");
stringList.add("my");
stringList.add("horse");

Iterator<String> iterator = stringList.iterator();
for (String s : stringList)
System.out.print(s + " ");



Enhanced for loop

int array[] = {1, 2, 3, 4};
int sum = 0;
for (int e : array) // e is short for element; i would be confusing
sum += e;
System.out.println(sum);


Enums

Java programmers rejoice with the availability of enums.

enum Suit { clubs, diamonds, hearts, spades };
for (Suit suit : Suit.values())
System.out.println(suit);


Formatted Output
Developers now have the option of using printf type functionality to generated formatted output. Most of the common C printf formatters are available.

System.out.printf("name count\n");
String user = "fflintstone";
int total = 123;
System.out.printf("%s is %d years old\n", user, total);

E altro,