Posts related to tag: Java 8


Stream reduce() vs. collect() in Java 8

In Java 8, the Stream.reduce() and Stream.collect() methods are used for performing reduction operations, but they are intended for different […] Continue reading »

Sort even and odd numbers in ascending & descending order in Java

To sort even and odd numbers in ascending and descending order in Java, you can utilize Java 8 features and […] Continue reading »

Java- Sort Even Number First and Maintain the Order

Sort Even Number First and Maintain the Order in Java: You have an array of integers with mixed numbers i.e. […] Continue reading »

IntStream summaryStatistics() in Java 8

In Java 8, the IntStream interface provides the summaryStatistics() method, which returns an IntSummaryStatistics object describing various summary statistics for […] Continue reading »

Java 8 Collectors.partitioningBy() Method Example

Java 8 Stream API’s Collectors.partitioningBy() method, which offers a powerful way to partition elements of a stream into two groups […] Continue reading »

Java Stream peek() Method Example

In this blog, we’ll explore the Java 8 Stream peek() method, understanding its purpose and demonstrating how it can be […] Continue reading »

Java 8– Find first and all smallest string in List

Using the Java 8 Stream API min method, you can find the first and all smallest strings from a List. […] Continue reading »

Java 8– Find first and all longest strings in List

In Java 8, you can find the first and all longest strings from a list using the Stream API along […] Continue reading »

Java 8- Count the occurrences of Character in String

In this Java 8 program, you will find how to  count the frequency of character in String using Stream API. […] Continue reading »

Functional Interface in Java 8

Java 8 introduced a significant enhancement known as lambda expressions, which allowed for more concise and expressive code. Alongside lambda […] Continue reading »

forEach() vs. forEachOrdered() in Java Stream

When working with Java Streams, you often encounter situations where you need to apply a function to each element of […] Continue reading »

1 2 3 5