Java 8 Released

2014/03/30

Tags: java

Whats new in Java 8? Where to start learning?

Last week we saw the new release of Java. Version 8 brings a lot of new features into the language. I think the most important are:

There is also a lot of smaller improvements and additions in the standard library.

Lamdas FTW! Image from http://www.jamesiliff.com/speechless-protagonists-spatial-storytelling-and-immersive-worlds-half-life-game-narrative-review-at-gdc-2012

I’m a huge fan of the functional programming paradigm and of course I’m very excited about the release. Hope it will be quickly and widely adopted in production. Also the library improvements will make a compelling alternative to popular external libraries like JodaTime and Guava. This is good, because I think everybody were including them, even for small projects.

How to get start with Java 8?

If you want to dig into more details of lambdas in Java 8 check these two articles by Brianz Goetz:

This is now Java (example from the latter)

Pattern pattern = Pattern.compile(\\s+");
Map<String, Integer> wordFreq =
    tracks.stream()
        .flatMap(t -> pattern.splitAsStream(t.name)) // Stream<String>
        .collect(groupingBy(s -> s.toUpperCase(),
            counting()));

Happy coding with Java 8!

>> Home