Doing it my way works on Windows. Doing it your way works on Windows as long as I use Java 7; it doesn't compile with Java 6.