1.GenericsAllows programmers to specify the types allowed for CollectionsAllows the compiler to enforce the type specifications//BeforeList stringList //In JDK 1.5List<String> stringList;2.Enhanced for loopA new language constuct for the Iterator pattern//Beforefor(Iterator i = line.iterator();i.hasNext(); ) { String word = (String)i.next(); …}//In JDK 1.5for(String word: line){ …}3.AutoboxingEssentially bridges between the “primitive” types (such as int, boolean) and [...]
Filed under: Interview Questions, JDK 1.5 features | 3 Comments »