Learn how to transition to functional-style programming using the new language features in Java 9, including lambdas and the streams framework.
- [Instructor] Hi, welcome to the course on Functional Programming with Streams in Java 9 by PACKT Publishing. My name is Marco Faella, and I am a professor of computer science at University of Naples, Italy. I've been teaching a number of classes there, including operating systems, compiler construction, and a class on advanced Java programming that I've been teaching for 11 years now.
I've also recently published a book on the Oracle Java certifications. This course will cover in detail most functional-style features of Java 9, including the stream library. This video provides you with a glimpse of the entire course which is divided into seven sections. This is the sequence of the seven sections comprising the course. In the first section, I will present the main ideas behind functional programming and a little history of this programming paradigm.
The second section introduces method references and lambda expressions, which are concise new syntaxes for referring to an existing method or for defining a new function on the fly. In the third, you will learn about a kind of interface called a functional interface, and you will see how these interfaces relate to lambda expressions and method references.
The fourth section starts our exploration of the stream framework, a new set of classes and interfaces that bring functional-style data processing to Java. The fifth section, called Stream Operations, describes the various built-in methods offered by streams. These methods provide the backbone of the stream framework.
The sixth section explains how streams can be used to easily and safety convert a sequential computation into a parallel one, thus taking better advantage of your multi-core hardware. Finally, the last section applies many of these functionalities to a full-fledged, non-trivial example, and the example we will use is the collision detection problem for two-dimensional games.
So the goal of this course is threefold. First, getting to know the new language features introduced in Java 8, namely functional interfaces, lambda expressions, and method references. Second, learning to use streams and parallel ones in particular for a variety of data processing tasks. Finally, all along the way, I will provide tips and guidelines for adapting traditional object-oriented programming to the functional style.
As far as the requirements are concerned, you are supposed to be familiar with basic Java, plus generics and standard collections, such as lists, sets, and maps. Regarding software, you just need to have an up-to-date Java SDK, at least version 8, and of course, you'll most likely want to use a modern Java IDE, such as Eclipse, NetBeans, or IntelliJ.
Thank you for choosing this course. I'm sure you'll learn a lot about the new ways of Java. See you in the next video.
Note: To get the best results from this course, you should be familiar with basic Java programming concepts, including lists, maps, and sets, and have a suitable IDE, such as Eclipse, NetBeans, or IntelliJ.
This course was created and produced by Packt Publishing. We are honored to host this training in our library.
- What is functional programming?
- What are functional interfaces?
- Writing lambda expressions
- Creating functional interfaces
- Composing functions
- Sequential data processing with streams
- Using parallel streams