Leanpub Header

Skip to main content

What's New in Java 8

An unofficial guide to Java and JDK 1.8

This book will help you understand Java 8, including Project Lambda, the new Date-Time API, Streams, Nashorn, and more. All readers will get all future updates and 10% of proceeds go to EFF. If you like this, please check out Adam's other books.

Free With Membership

The author is letting you choose the price you pay for this book!

Pick Your Price...
PDF
EPUB
WEB
297
Readers
55
Pages
8,637Words
About

About

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).

DisclaimerJava is a registered trademark of Oracle. You can find Java here on Oracle's website.

Share this book

Categories

License

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License

Price

Pick Your Price...

With Membership

Free!

$15.00

You pay

$15.00

Author earns

$10.80

Cause gets

$1.20
$

All prices are in US $. You can pay in US $ or in your local currency when you check out.

EU customers: prices exclude VAT, which is added during checkout.

...Or Buy With Credits!

Number of credits (Minimum 0)

0
The author will earn $0.00 from your purchase!
You can get credits monthly with a Reader Membership

Author

About the Author

Adam L. Davis

Adam Davis makes software. He's spent many years developing in Java (since Java 1.2) and has enjoyed using Spring, Hibernate, Grails, and many others. He has used Java, Groovy, JavaScript, AWS, and much more to build applications for over a decade and has worked at both large and small corporations. Adam is a Certified Spring Professional and has a Masters and a Bachelors degree in Computer Science from Georgia Tech.

http://adamldavis.com

Contents

Table of Contents

Preface

1.Overview

2.Lambda Expressions

  1. 2.1Syntax
  2. 2.2Scope
  3. 2.3Method references
  4. 2.4Functional Interfaces
  5. 2.5Comparisons to Java 7

3.Default Methods

  1. 3.1Default and Functional
  2. 3.2Multiple Defaults
  3. 3.3Static Methods on Interface

4.Streams

  1. 4.1What is a Stream?
  2. 4.2Generating Streams
  3. 4.3For Each
  4. 4.4Map/Filter/Reduce
  5. 4.5Parallel Array
  6. Groovy GPars
  7. 4.6Peek
  8. 4.7Limit
  9. 4.8Sort
  10. 4.9Collectors and Statistics
  11. 4.10Grouping and Partitioning
  12. 4.11Comparisons to Java 7

5.Optional

  1. The Billion Dollar Mistake
  2. Stream Optional

6.Nashorn

  1. 6.1jjs
  2. 6.2Scripting
  3. 6.3ScriptEngine
  4. 6.4Importing
  5. 6.5Extending
  6. 6.6Invocable

7.New Date and Time API

  1. 7.1New Classes
  2. 7.2Creation
  3. 7.3Enums
  4. 7.4Clock
  5. 7.5Period and Duration
  6. 7.6Temporal Adjusters
  7. 7.7Instant
  8. 7.8Time Zones
  9. 7.9Backwards Compatibility

8.No More Permanent Generation

9.Miscellaneous

  1. 9.1Base64
  2. 9.2CompletableFuture
  3. 9.3Annotations on Java Types
  4. 9.4Repeating Annotations

10.Functional Programming in Java 8

  1. 10.1Functions
  2. 10.2Immutability
  3. 10.3Concurrency
  4. 10.4Tail-Call Optimization

11.Conclusion

Backports

Contact the Author

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

Causes

Causes Supported

Electronic Frontier Foundation

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.
From the Internet to the iPod, technologies are transforming our society and empowering us as speakers, citizens, creators, and consumers. When our freedoms in the networked world come under attack, the Electronic Frontier Foundation (EFF) is the first line of defense. EFF broke new ground when it was founded in 1990—well before the Internet was on most people's radar—and continues to confront cutting-edge issues defending free speech, privacy, innovation, and consumer rights today. From the beginning, EFF has championed the public interest in every critical battle affecting digital rights.

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 earned over $14 million writing, 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

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub