Old question, new answer (for Java 8)

IntStream.range(0, 10).forEach(
        n -> {
            System.out.println(n);
        }
    );

or with method references:

IntStream.range(0, 10).forEach(System.out::println);