Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 1.11 KB

MIGRATION.adoc

File metadata and controls

29 lines (23 loc) · 1.11 KB

migration java

JDK 1.5 features

  1. autoboxing / autounboxing

  2. generics

  3. for-each loop

  4. vararg (Variable-Length Arguments)

  5. emun (Enumerations)

  6. annotations getClass().getAnnotation()

  7. static import import static java.lang.Math.*;

  8. c-lang printf() new Formatter().format("dec: %d, hexa: %x, char: %c, doub: %1.4f.", 50, 50, 'A', 3.14).toString();

  9. Scanner new Scanner("10 5 3 1") .nextInt()/.hasNextInt()

  10. collections (generics) new ArrayList<Integer>(); new PriorityQueue<Double>()

  11. high-performance immutable StringBuilder (replacement of mutable StringBuffer)

JDK 1.4 features

  1. assert operator java -ea AssertPractice

  2. regular expressions Pattern.compile(matchObj).matcher(origObj).group()/start()/end()

  3. splitting "a String".split(" ");

  4. exception chaining / wrapping

links: