Posts related to tag: Java 8

How to sort Map by Key or Value in Java 8

A Map can also be sorted with stream.sorted() method in Java 8. We can sort the Map based on its […] Continue reading »

Java 8 – How to sort Set with stream.sorted()

In this quick tutorial, we’ll learn how to sort Set in Java 8. stream.sorted() is a predefined method of Stream […] Continue reading »

How to sort list in Java 8

In Java 8, the elements of a list are sorted by calling stream.sorted() method of Stream interface. As we know, […] Continue reading »

Java 8 Stream- Sum of List of Integers

Java 8 Stream interface provides mapToInt() method to convert a stream integers into a IntStream object and upon calling sum() method […] Continue reading »

How to iterate Enum in Java

This guide walks you through how to iterate Enum in Java/Java 8. .values() method of an enum class return an […] Continue reading »

Spring Boot- Display image from database and classpath

On this page, we are going to learn how to display image from the database and classpath location using Spring […] Continue reading »

Best practices to avoid NullPointerException in Java

In this tutorial, we will discuss the best practices to avoid or handle NullPointerException in Java. NullPointerException generally threw when […] Continue reading »

Check HashSet contains element case insensitive in Java

In this example, we will show you how to check HashSet contains element case insensitive in Java. contains() method of […] Continue reading »

How to find distinct elements in a list in Java

Java 8 introduced distinct() method in Stream interface to find the distinct element in a list. distinct() method returns a stream […] Continue reading »

1 2 3