Jump to ratings and reviews
Rate this book

Modern Java Recipes: Simple Solutions to Difficult Problems in Java 8 and 9

Rate this book
The introduction of functional programming concepts in Java SE 8 was a drastic change for this venerable object-oriented language. Lambda expressions, method references, and streams fundamentally changed the idioms of the language, and many developers have been trying to catch up ever since. This cookbook will help. With more than 70 detailed recipes, author Ken Kousen shows you how to use the newest features of Java to solve a wide range of problems. For developers comfortable with previous Java versions, this guide covers nearly all of Java SE 8, and includes a chapter focused on changes coming in Java 9. Need to understand how functional idioms will change the way you write code? This cookbook―chock full of use cases―is for you. Recipes

322 pages, Paperback

Published September 19, 2017

22 people are currently reading
129 people want to read

About the author

Ken Kousen

8 books13 followers
I am the author of five books, four about software development and one about managing your manager. My technical books are "Kotlin Cookbook", "Modern Java Recipes", and "Gradle Recipes for Android", all from O'Reilly Media, and "Making Java Groovy" from Manning.

My latest book is called "Help Your Boss Help You" and is all about building a relationship with your manager that gets you what you want from your job when you want it. The book is intended for working professionals, defined as people who currently care more about doing their job well than moving through the ranks of people management, but who still have to deal with managers all the time.

I'm happy to try to answer any questions about any of my books here.

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
25 (38%)
4 stars
28 (43%)
3 stars
10 (15%)
2 stars
1 (1%)
1 star
1 (1%)
Displaying 1 - 8 of 8 reviews
Profile Image for Łukasz Słonina.
124 reviews25 followers
November 9, 2017
Very nice book to read, everything explained clearly with examples.
The only thing that I don't like is how the problems are formulated - for me they are more like solutions (I would like the problem to be something about design, so that construction from Java 8/9 would help me to solve that, not that I just don't know how to use particular syntax).
Profile Image for Jeanne Boyarsky.
Author 28 books76 followers
September 29, 2017
“Modern Java Recipes” assumes you know some version of Java. If you've never used Java 8 before, it's a fast paced introduction that focuses on the parts you are likely to use. If you have used Java 8 before, it helps you learn more deeply along with understanding idioms and when to best apply various techniques.

The book also covers key parts of Java 9. It was published while there was still uncertainty about what Java 9 was going to launch with. Conveniently for Ken, what was released for Jigsaw matches what he covered in the book! The intro to Jigsaw/modules is just the basics. The other features are smaller so able to be covered completely.

I've been using Java 8 for a few years and still managed to learn some new APIs and techniques like codepoints. I like how Ken shows the primitive streams and uses at the same time he introduces the interfaces. I also learned that I've been writing resource leaks calling Files.lines() for years. Never thought to use try-wth-resources around it. Oops. And I was reminded to use Function.compose() andThen().

I like that Ken uses JUnit to illustrate some concepts. There was one place I wanted him to use assertSame instead of assertTrue. I mention this because that was the only thing I disagreed with in the whole book and it's pretty minor (and not about Java 8/9 anyway!) One other minor complaint. The book mentions that @SafeVarargs is described in the appendix but I couldn't find it there.

---
Disclosure: I received a copy of this book from the publisher in exchange for writing this review on behalf of CodeRanch.
Profile Image for Zbyszek Sokolowski.
299 reviews16 followers
October 14, 2018
I worship books written by Ken Kousen. His videos are also pretty cool. Modern Java Recipes shows how different stuff in Java 8/9 should be implemented. This is a form of recipes, but I suspect only to give a form to book. The book should be mandatory to every Java developer, even for seasoned is a good refreshment. Recommended!
Profile Image for Katricia.
245 reviews5 followers
March 31, 2023
If I was ever an expert enough at a topic to write a book about it, I can only hope it'd turn out more-or-less like this.

I found the appendix discussion on reading complicated method signatures especially helpful.
Profile Image for Nariman.
86 reviews119 followers
July 20, 2025
Even after 10 years of working as a Java developer and using Java 8 and 9 features daily, I learned a lot from this book. Highly recommended if you want to deeply understand how Java works under the hood after the major changes since version 8.

Profile Image for Abdur Rahman.
11 reviews1 follower
August 5, 2018
Was a very good introduction to Java 8 FP, and was one of the first things I read on the topic. Has helped me tremendously.
Displaying 1 - 8 of 8 reviews

Can't find what you're looking for?

Get help and learn more about the design.