Default Methods are added to Java 8 largely to support library designers by enabling them to write more evolvable interfaces. They’re important because you’ll increasingly encounter them in interfaces, but because relatively few programmers will need to write default methods themselves and because they facilitate program evolution rather than helpi...

Read More

flatMap in Java 8 (as described in the below figure) lets you replace a value with a Stream and concatenates all the streams together. You’ve already seen the map operation in this article, which replaces a value in a Stream with a new value. Sometimes you want a variant of map in which you produce a new Stream object as the replacement. Frequently...

Read More

Use the reduce operation when you’ve got a collection of values and you want to generate a single result. In earlier articles, we used the count,  min and max methods, which are all in the standard library because they are common use cases. All of these are forms of reduction. Let’s demonstrate the reduce operation by adding up streams of numbers. ...

Read More

In Java 8 the most important library changes are made in Collection API and there is also a new addition named Stream. Streams allow us to write collections-processing code at a higher level of abstraction. Stream can hold different types of data, following are some examples: Stream : A Stream of Array of Strings Stream Read More

In this tutorial we will explain a new feature of Java 8 known as constructor reference. This is same as method reference feature in Java 8. Constructors are a special kind of methods which are responsible for Object initialization. So we can make Constructor Method References like any other method reference. The syntax for constructor reference is...

Read More

FOLLOW US ON LinkedIn



Explore Tutu'rself