Theres A Better Way For the programmer still stuck on JDK6 See Examples.java Syntactical niceities in JDK7: Try-With-Resources [1] Switch string [2] Binary literal [3] Underscores in Numerical literals [4] Multi-catch [5] Diamond operator [6]