Learn ways of Collecting a Stream of List into Map using Java Streams API. Using Collectors.toMap and Collectors.groupingBy with example.
Welcome to the series of Java 8 Tutorials. In this learning series we will understand the basic differences between traditional Java and Java version 8 with plenty of useful examples.
The Java 8 was Java’s biggest release since inception which brought in many great changes to Java Platform. The capabilities of lambda expressions and streams was really long awaited in Java. They also modified the Collections Framework components and Date and Time API.
Java’s collection framework is based on Interfaces. Which is why, Java could never change any of the Collection framework APIs. But in this release, Java added concept of default methods in interfaces to solve the long pending issue. First time since the inception we saw new methods in the ArrayList and Maps etc.
In the mid of 2012, I was so fascinated by the (then) future features of Java, that I used the developer builds to try and prepare example source codes and started with this Series of Tutorials.
Please keep posting comments and suggestions about my work.
In this Java 8 Optional Examples Tutorial learn How to avoid Nulls and Null Pointer Exceptions and avoid Null Checks using Java 8 Optional.
Learn with Examples to use Java Method Reference and Constructor Reference for passing or expression assignment
A tutorial on Java Functional Interfaces – Learn with code examples the concept of Functional Interfaces and why were they added in Java 8.
Java 8 Streams – Terminal Operations describes Java 8 streams Matching, Finding, Reducing, and Optional with detailed examples
Java 8 Streams Intermediate Operations like map, flatMap, filter, sorting and limit are explained in detailed with simple examples
Java 8 Streams are lazy and still help in faster processing and improving speed of your application. Learn How.
This article helps Understanding Java 8 Streams API. Learn what are streams, how different they are from Collections, stream operations, behaviours with simple examples
Java 8 Date and Time API is modified. Learn about what has changed and how better it is compared to old API or Joda Time API. Explained in detailed with examples.
Before we learn Java 8 Date and Time API, let’s have a looks at what is Joda Time API and how it is different than old date and time API. This will help us understand how better Java Date and Time API is.
Before diving deeper into Java 8 Date and Time API, let’s first understand existing Date and Time API. See the main features and examples of Date and Time API.
A guide to Java 8 Collections API enhancements. Learn about the changes like streams, new methods with the help of code examples.
Java 8 has exciting features like Closures, and Lambda Expressions. In this article we will look deeper into what is a Lambda expression and how Java supports it.