Jump to ratings and reviews
Rate this book

Java 8 in Action

Rate this book
Java 8 in Action is a clearly written guide to the new features of Java 8. The book covers lambdas, streams, and functional-style programming. With Java 8's functional features you can now write more concise code in less time, and also automatically benefit from multicore architectures. It's time to dig in!

394 pages, ebook

First published January 1, 2014

Loading interface...
Loading interface...

About the author

Raoul-Gabriel Urma

3 books9 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
333 (50%)
4 stars
246 (37%)
3 stars
64 (9%)
2 stars
11 (1%)
1 star
4 (<1%)
Displaying 1 - 30 of 76 reviews
Profile Image for Krishna Chaitanya.
68 reviews121 followers
August 30, 2019
Excellent material, if you want to have a good grasp of Java 8 features in one book then this is it.
I've seriously wanted to learn java 8's Lamda features because it introduced functional style programming in Object-Oriented Java, I've completed few online courses on Java 8 though they were good but not in-depth.

That missing feeling is vanished after reading this book. The concepts are clearly explained with detailed examples also by stating and explaining underlying design and classes.

This book also includes refactoring the legacy code to Java 8 which is super helpful if you're working on a legacy Java project.

The exercises are challenging enough to put your learning into practice. I highly recommend this if you want solid understanding of Java 8 features.
Profile Image for Christian Roman Rua.
15 reviews6 followers
April 2, 2016
Great book to take your first steps on Java 8.
The language had a great deal of changes for this version that when you read code written in Java 8 and you re not aware about Lambdas and Streams, it will seem a different language than the old good Java.
I recommend this book to any programmer that likes to keep himself updated with the new things that Java has to offer nowadays; there are many interesting and easy to understand examples that will make your reading and learning experience quite smooth.
Profile Image for Stanley Kubasek.
10 reviews2 followers
May 1, 2015
Very good java book. A bit wordy, one of the best java books out there. Great coverage on all new java8 features.
Profile Image for Michael Koltsov.
93 reviews58 followers
February 3, 2020
Rarely, I want to purchase a book I've read as a hard copy. I wanted to buy this book badly.

Only after checking the cost of this book in Poland I realized that at a price of yearly subscription to Safari Books buying a huge pile of dead wood is not wise enough for me.

I had a huge gap in my Java experience due to the fact that I've made a switch to Scala and then to other languages most of them had nothing to do with JVM. Javascript, Ruby, Python, GO... you name it, I was paid to write in it mostly thanks to my employers' kindness and not because of any particularly need. The main reason why I've switched from Java to Scala was that the latter felt much sexier with lots of syntactic sugar and nice FP abstractions that felt much closer than the monstrosity I often saw in the java projects I wad to work on. Did I also mention that one of the first programming languages I've learned was LISP? Functional programming was a big part of my education.

And then after all these years I started to see a gradual change in the way way how the Java code is written that felt similar to Scala but without the complexity that it had. Especially, after loosing all my illusions with GO I decided to give new Java a try. I played a bit with streams and lambdas, but neither could I understand how their worked nor use them efficiently.

This book allowed me to fill this gap. If you're coming from Java 6 & 7 this book is a must for you. Lots of example, detailed explanations with multiple peeks under the covers of JVM.

The only minor issue is that after changing the release policy Java went quite far from the changes that are described in this book. Too bad this book isn't updated after every new Java version goes GA
Profile Image for Patrick.
17 reviews1 follower
October 21, 2014
This is a great book for anyone who has previous understanding of Java below 8. It's focused on working with both Object Oriented Programming and Functional Programming. Parts 1 - 3 cover the new features of the language while the fourth is about functional programming. For those who have experience in Scala, the examples in this section are for both Java and Scala.
I've been using Java in my day to day activities since the year 2010. This book has now introduced me to the functional world with Java, after using Scala for a while. I strongly recommend this book to those developers who want to understand functional programming or to those that already know it but want to be up to date with Java 8.
Profile Image for Zbyszek Sokolowski.
272 reviews11 followers
December 30, 2016
The book is pretty decent. It differs from chapter to chapter. Yes it couldbe better, some parts are very good and makes good reading and education while some examples are too convoluted and academic. I think that the book would be better if provided examples would be even easier. Those should be less showing authors brilliance and more didactic. I think that questionable is to move description of new Java features to appendix and instead of it discuss Scala. I like chapters regarding CompletableFuture. For sure I will return to some covered subjects and then read some chapters again.
Profile Image for Xanan.
59 reviews5 followers
April 18, 2018
Complete, accurate and comprehensive.

This is not a book on Java programming that happens to describe Java 8 features as well.
It focuses only on Java 8 new features and Java programming expected.

Streams and lambda expressions take up most of the book but interface default methods, the new Date/Time API, Optional and CompletableFuture are also discussed adequately.
Topics are introduced gently and discussed comprehensively and thoroughly.
Profile Image for Jean Tessier.
148 reviews22 followers
May 2, 2021
I had been coding in Groovy for the previous 10 years and I needed to get up to speed on the new Java idioms, like lambdas and streams.

The book does a good job of covering the Stream API and how it benefit from lambdas and method references. I like how it can infer the functional interface of a lambda expression based on context (see Figure 3.5 on page 67). It is an interesting alternative to the more loosely typed approach in Groovy.

I find it interesting how streams use a lazy implementation and how their pipelines are demand-driven. It makes infinite streams possible, with iterate (takes a UnaryFunction) and generate (takes a Supplier) variations. It does make it more difficult to have one pipeline compute multiple results, though. I couldn't find a justification as to why there are specialized versions for int, long, and double, but not for float (or byte, for that matter). The contracts for Collector and Spliterator are rather complex.

I'm not keen on using Optional all over the place, especially in light of Groovy's null-safe dereferencing operators ?. and .*. It does help with creating call chains, but the mental load is quite severe. Combine it with CompleteableFuture and you have to think really hard about what is going on for every method call.

All these new APIs rely a lot on static helper methods. I'd need some actual practice using them to understand better how to unit test code that's using them.

I was hopeful for the Flow API and reactive programming, but there is still a lot of wiring up to do. I was hoping for something closer to event-based models where publishers and subscribers don't know about each other, and how you can get temporal decoupling too, where they don't have to be available at the same time.

I don't see the need for the Java module system at this time.

The parts on functional programming were interesting, but I wouldn't want to do it in Java. Functional languages handle these concepts much better. Still, in order to use streams well, you need to know about pure functions and write code with no side-effects.

The authors very frequently refer back to previous sections. It gets a little annoying after a while. But I can see how it can be helpful if someone starts reading in the middle of the book, chasing after a specific topic, for them to understand where the current context is coming from.

The tone can seem at times a little condescending towards more theoretical approaches, like pure mathematics. It definitely favors more practical experimentations.

One quick quote that gave me pause:

Programmer efficiency is often more important than small differences in execution time. p. 458

This is dangerous advice if you don't give more context. How often is that code executed? How critical is it for its enclosing code to be responsive? I agree that 90% of the time, programmer efficiency will win. But you must not lose sight of that other 10%.
Profile Image for Gediminas.
156 reviews9 followers
October 19, 2017
Great for novices to read, good for professionals to flip through

I have a good command of Java 8 features, so I flipped through the parts I knew already (which seemed well explained) - took me several hours to read at most.

It seems like a good intro to functional style Java, as well as other new features introduced in Java 8.
A significant part is also dedicated to functional programming style in Java and Scala languages, as well as likely language features to come in future releases - these parts were the most interesting for me.
Profile Image for Miloš.
66 reviews3 followers
April 21, 2020
Even though I've been working with Java 8 for some 2 years (almost 3 if you count playi g around with the developer preview version) I still found this book to be an excellent guide to working with Java 8. There's lots of great examples and in-depth explanations of all the inner workings of both lambdas and streams. The author is also a convincing FP evangelist, making me want to return to learning Scala again.
Profile Image for Daniel Dent.
69 reviews4 followers
January 31, 2015
I can't help but think this book could've been easier to grasp with better flow. For example, Functional Interfaces are never really dived into making Streams much harder to understand. I for sure learned a lot with this book but there must be better book out there on Java 8.
53 reviews
June 13, 2017
Completely unnecessary are chapters about Scala - even though they are extremely informative.
Profile Image for Daren Thomas.
5 reviews
March 19, 2019
This book was informative and technically sound with a nice mix of explanation and examples. Personally I liked that the code listings were large enough to illustrate the topic, but not so large they needed to be separate from the book. Sometimes it's nice to have everything in one place (i.e. on the paper in front of you). Overall it was well written and has earned a place on my reference shelf.

My only (minor) complaint is that the book is a little verbose at times. I found that a little ironic considering a major benefit of Lambdas is reducing verbosity in code.
Profile Image for Akash Goel.
156 reviews11 followers
January 29, 2017
Probably the most engaging text on a programming language that I've read. The authors present a lot of use cases and give simple examples, making it blissfully simple to understand the concepts of Java 8 to even beginner Java programmers like me. I would recommend this in a heartbeat to anyone who's a programmer, but new to Java.
Want to read
December 18, 2019

Java 8 in Action (ebook)
by Raoul-Gabriel Urma
Java 8 in Action (ebook)
by Raoul-Gabriel Urma
Java 8 in Action (ebook)
by Raoul-Gabriel Urma
Java 8 in Action (ebook)
by Raoul-Gabriel Urma
Java 8 in Action (ebook)
by Raoul-Gabriel Urma
Java 8 in Action (ebook)
by Raoul-Gabriel Urma
Java 8 in Action (ebook)
by Raoul-Gabriel Urma
Java 8 in Action (ebook)
by Raoul-Gabriel Urma
This entire review has been hidden because of spoilers.
2 reviews1 follower
September 19, 2020
Reading a Technical book can be fun Too!

Starting from a brief explanation of a feature, why it came into picture and how you should use it as a professional, provided with examples; each chapter contains an excellent guide of leveraging new features while following programming conventions and standards.

Profile Image for Vinicius Souza.
44 reviews
March 2, 2022
Are you a Java developer that needs to update yourself regarding the newer versions? This is the best book for you. Unfortunately, it covers only until Java 11, but it is enough to get the most important features from 8 to 11. From the new additions to the JDK, I missed only the NIO 2 API, but it would (probably) require a new book just for it.
Profile Image for Balamurugan Krishnamoorthy.
30 reviews10 followers
March 20, 2022
Best examples & illustrations to understand key concepts crystal clear. Majority of the book is all about streams and functional paradigm. However
, I found the Concurrency chapters to be crisp and covers the essential that are introduced in 8 and 9… It’s serves as a good intro to reactive programming also.
Profile Image for Lukasz.
2 reviews
July 30, 2018
Very comprehensive and easy to read introduction to Java 8 and couple other features that were introduced lately. Great for people actually know Java, but want to update their knowledge with stuff that every Java developer should know.
Profile Image for Anna.
1 review
August 4, 2018
Great explanation of streams, lambdas, optionals and completable futures. Would highly recommend as a brief introduction to functional programming. Also great for anyone willing to catch up on one of the most important updates for the Java language.
Profile Image for Dariusz Mydlarz.
23 reviews4 followers
November 3, 2018
Even though Java 8 is with us for a couple of years it is still worth to go deeper into details. This book is a great resource to do so. I mostly liked the chapter about parallel data processing and performance.
255 reviews5 followers
August 18, 2019
I read the earlier edition of this book, which was titled "Java 8 in Action". This edition covers some topics from Java 9, and expands coverage of reactive programming. Overall a pretty good introduction to the language, concentrating on streams, lambdas, and functional-style programming.
Profile Image for vinayak karigar.
14 reviews
November 20, 2020
Excellent book to acquire functional style programming perspective with Java. Also the authors have clearly explained the reasons behind new features being introduced in the language and how they compare with other competing JVM languages.
Profile Image for Joshua.
23 reviews3 followers
November 9, 2021
Can't recommend enough. Functional style programming definitely improves readability, reinforces what you're intending to do, shortens code length, and reduces verbosity. Can't wait for a day when C++ standard finally incorporate some of the features Java 8 added years ago now.
Profile Image for Nazar Lelyak.
41 reviews6 followers
August 9, 2022
Nice book with explanation of Java 8+ features.
Special explanation covers lambdas, parallel streams and complitable futures.
It is improved version of previous book.
Also, it includes some details of Scala compare to Java.
8 reviews
March 31, 2018
Very balanced coverage of Java 8 features, not to shallow to be useless for an experienced developer but not too deep that it becomes a book about functional programming or concurrency.
15 reviews
June 9, 2018
Very good introduction to Java8, easy to read. Written in a convenient way, I was not hammered with pure theoretical definitions, but get good examples. I recommend this position.
September 2, 2018
A hands-on introduction to the new Java 8 features. Beginning with lambadas and going all the way through each new concept, including streams, optionals, default methods, completable future, new date api. Each concept is well explained and compared to 'the old way' of coding. There is a dedicated chapter showing how to refactor existing pre-Java 8 code using the new Java features.

This book is not recommended for someone who just starts his adventure with programming. It's good to have some working knowledge of Java before reaching for this book.
Displaying 1 - 30 of 76 reviews

Can't find what you're looking for?

Get help and learn more about the design.