Sunday, April 8, 2012

Difference in Java 1.4 and Java 1.5

Java 1.5 has many new features, compare to Java 1.4.

Some of the features in J2SE 5.0 that were added to Java 1.4 are:
  • Generics (e.g. typed collections, like Set)
  • Enhanced for loop (for (String s : set) {...}) the foreach loop
  • Autoboxing/Autounboxing (automatically convert between types like Integer to int and vice versa)
  • Typesafe enums (enum is now a keyword, types can be created out of enums)
  • Varargs (for printf() function, allows variable number of arguments)
  • Static import (can now import static methods of a class, such as java.lang.Math)
  • Annotations


Loads of Love,
Ravi..

No comments:

Post a Comment