Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Java Functional Programming

You're reading from   Learning Java Functional Programming Create robust and maintainable Java applications using the functional style of programming

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781783558483
Length 296 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Richard M. Reese Richard M. Reese
Author Profile Icon Richard M. Reese
Richard M. Reese
Richard M Reese Richard M Reese
Author Profile Icon Richard M Reese
Richard M Reese
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Getting Started with Functional Programming 2. Putting the Function in Functional Programming FREE CHAPTER 3. Function Composition and Fluent Interfaces 4. Streams and the Evaluation of Expressions 5. Recursion Techniques in Java 8 6. Optional and Monads 7. Supporting Design Patterns Using Functional Programming 8. Refactoring, Debugging, and Testing 9. Bringing It All Together Index

Chapter 4. Streams and the Evaluation of Expressions

In this chapter, we will examine how Java 8 supports the concept of streams. A stream can be thought of as a sequence of elements processed by a series of methods using a fluent interface. The stream concept is supported by the Stream class.

We will begin with a brief overview of the Stream class and its methods. After conveying the essence of the stream technique, we will examine how streams are created and show how they can replace imperative and object-oriented approaches to solve similar problems. The intent is to provide an overview of the Stream class and its methods. A detailed coverage of each method is not possible here.

The topics you will cover include the following:

  • Creating fixed and infinite length streams
  • Filtering a stream
  • Sorting streams
  • Mapping elements of a stream

How stream methods are evaluated is also of interest—either in a lazy or eager manner. How they are evaluated affects when their methods are executed...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image