Å·±¦ÓéÀÖ

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

205 people are currently reading
1,070 people want to read

About the author

Raoul-Gabriel Urma

3Ìýbooks10Ìý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
352 (49%)
4 stars
268 (38%)
3 stars
68 (9%)
2 stars
13 (1%)
1 star
4 (<1%)
Displaying 1 - 30 of 85 reviews
Profile Image for Krishna Chaitanya.
68 reviews118 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.
109 reviews69 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.
291 reviews16 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 Jean Tessier.
161 reviews31 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.
215 reviews15 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 ²Ñ¾±±ô´ÇÅ¡.
67 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 reviews5 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.
62 reviews
June 13, 2017
Completely unnecessary are chapters about Scala - even though they are extremely informative.
Profile Image for Viktor Malyshev.
132 reviews4 followers
October 30, 2023
This book focuses on Java 8-9 features for the most part. And this is the first strange thing I've noticed.
I agree, java 8 brought many changes, like pretty much functional programming. This is probably the most significant change out there. And I enjoyed the details about that. Aside from that, Streams API, interfaces, and Flow API. Those are good parts.
But, since the focus was on those specific versions, they became outdated so fast. At the time I wrote this review, Java 22 was released. So, that's the first problem.
Another one is that book sometimes is too theoretical and therefore contains too much water. I feel like it could be at least 2-3 times smaller without losing its main ideas.
The last thing is a comparison with Scala, why is it needed? I mean, if we are talking about functional programming, of course, Scala is better. I don't think Java would ever go that far, esp with backward compatibility. So, I didn't get that.
Overall, interesting book that covers quite a lot of functional Java programming, worth reading at least those parts.
Profile Image for Yifan Yang.
43 reviews6 followers
October 3, 2023
This book covers many critical features introduced since Java 8. The explanations are clear and accompanied by abundant examples to clarify the concepts. It helps developers bridge their understanding to modern Java features, particularly those related to Streams and the idea of functional programming.

I would recommend this book to Java developers of all levels, whether to learn new concepts or to consolidate existing knowledge, guided by the author's recommendations.

The only shortcoming of this book is that some topics do not provide comprehensive guidelines on the API or practical usage, likely due to space constraints.
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 Amarildo.
4 reviews5 followers
October 8, 2023
The transition from previous Java versions to Java 8 can feel like learning a new language, especially when dealing with Lambdas and Streams. This book effectively bridges that gap, allowing you to see Java in a new light and realize the full potential of functional programming.
The early chapters are particularly successful in my opinion, though not all chapters are on the same level. For example, the chapter on modularity may leave you feeling unsatisfied because, after finishing it, you realize you have gained little practical knowledge.
2 reviews
October 4, 2024
This book is absolutely fantastic. It taught me so much on functional programming on java and declarative approach/philosophy. Really nice if you would like to learn more about Optional, Stream and asynchronous programming in java. But there is so much more to it. Highly advised if you are a professional Java developer, enjoy the language and get a bit deeper on it as well as writing cleaner code(If you believe declarative is cleaner). It is generally super light to read except some sections.
Profile Image for Akash Goel.
164 reviews13 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.
1 review
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.
53 reviews1 follower
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 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 reviews3 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 reviews7 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.
28 reviews4 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.
57 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.
Profile Image for Hiep Pham.
57 reviews34 followers
April 2, 2025
The author's thorough explanation and practical examples make this book truly valuable.

You just don't learn that Java has this functionality, but also understand the *why*. I learned a ton about functional and concurrency.
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.
Displaying 1 - 30 of 85 reviews

Can't find what you're looking for?

Get help and learn more about the design.