What's New in Java 8
What's New in Java 8
An unofficial guide to Java and JDK 1.8
About the Book
If you're just getting to Java 8, I definitely recommend@adamldavis' book -- very concise and helpful. -Fred Jonsson
Java 8 is a giant step forward for the Java language. In Project Lambda, Java gets a new closure syntax (lambda expressions), method-references, and default and static methods on interfaces. It manages to add many of the features of functional languages without losing the clarity and simplicity Java developers have come to expect. In addition, many of the existing Java core library classes have been enhanced with the new Streams API.
This ebook will help you understand Java 8, including: Project Lambda, the new Date-Time API, Streams, default methods, Nashorn, and more.
This book is 100% complete and available in print here and other places.
If you like this, please check out Adam's other books: Learning Groovy, Modern Java Second Edition, and Modern Programming Made Easy.
10% of all proceeds go directly to the Electronic Frontier Foundation (EFF).
Disclaimer: Java is a registered trademark of Oracle. You can find Java here on Oracle's website.
Bundles that include this book
Table of Contents
- Preface
- 1. Overview
-
2. Lambda Expressions
- 2.1 Syntax
- 2.2 Scope
- 2.3 Method references
- 2.4 Functional Interfaces
- 2.5 Comparisons to Java 7
-
3. Default Methods
- 3.1 Default and Functional
- 3.2 Multiple Defaults
- 3.3 Static Methods on Interface
-
4. Streams
- 4.1 What is a Stream?
- 4.2 Generating Streams
- 4.3 For Each
- 4.4 Map/Filter/Reduce
- 4.5 Parallel Array
- 4.6 Peek
- 4.7 Limit
- 4.8 Sort
- 4.9 Collectors and Statistics
- 4.10 Grouping and Partitioning
- 4.11 Comparisons to Java 7
- 5. Optional
-
6. Nashorn
- 6.1 jjs
- 6.2 Scripting
- 6.3 ScriptEngine
- 6.4 Importing
- 6.5 Extending
- 6.6 Invocable
-
7. New Date and Time API
- 7.1 New Classes
- 7.2 Creation
- 7.3 Enums
- 7.4 Clock
- 7.5 Period and Duration
- 7.6 Temporal Adjusters
- 7.7 Instant
- 7.8 Time Zones
- 7.9 Backwards Compatibility
- 8. No More Permanent Generation
-
9. Miscellaneous
- 9.1 Base64
- 9.2 CompletableFuture
- 9.3 Annotations on Java Types
- 9.4 Repeating Annotations
-
10. Functional Programming in Java 8
- 10.1 Functions
- 10.2 Immutability
- 10.3 Concurrency
- 10.4 Tail-Call Optimization
- 11. Conclusion
- Backports
- Contact the Author
- Notes
Causes Supported
Electronic Frontier Foundation
Defending your civil liberties in a digital world.
https://www.eff.org/Based in San Francisco, EFF is a donor-supported membership organization working to protect fundamental rights regardless of technology.
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them