SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

JAVA 8 / NOTES</>↗
Java 814 Jan 2024

How do I use Collectors.partitioningBy() method?

Collectors.partitioningBy() is a special case of a grouping collector in Java’s Stream API. It partitions or divides the input elements into two groups, based on the result of a Predicate function. One group for which the Predicate function returns true, and the other where it returns false. Each group is a List of elements, and […]

Wayan · 2 min read
JAVA 8 / NOTES</>↗
Java 813 Jan 2024

How do I use Collectors.groupingBy() method?

In Java 8, the Collectors.groupingBy() method in the Stream API is used to group elements of the stream into a `Map“ based on a categorization function. Here’s a basic example: package org.kodejava.stream; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; public class CollectorsGroupingBy { public static void main(String[] args) { List<String> names = […]

Wayan · 3 min read
JAVA 8 / NOTES</>↗
Java 813 Jan 2024

How do I use Collectors.summarizingInt() method?

The Collectors.summarizingInt method is actually similar to the summaryStatistics we discussed in the previous example. It returns a special class (IntSummaryStatistics) which encapsulates a set of summary statistical values for a stream of integers. Here’s an example: package org.kodejava.stream; import java.util.Arrays; import java.util.IntSummaryStatistics; import java.util.List; import java.util.stream.Collectors; public class SummarizingIntExample { public static void ma...

Wayan · 2 min read
JAVA 8 / NOTES</>↗
Java 813 Jan 2024

What is the summaryStatistics() method in Java Stream API?

The summaryStatistics method is a handy utility in the Java Stream API that returns a special class (IntSummaryStatistics, LongSummaryStatistics, or DoubleSummaryStatistics) encapsulating a set of statistical values: the count, sum, minimum, maximum, and average of numbers in the stream. Here’s a basic example using IntSummaryStatistics: package org.kodejava.stream; import java.util.Arrays; import java.util.IntSummaryStatistics; import java.util.List; public class […]

Wayan · 2 min read
JAVA 8 / NOTES</>↗
Java 813 Jan 2024

How do I use averaging collectors in Java Stream API?

In Java Stream API, there are several collectors you can use to calculate the average of numbers. The purpose of averaging methods or collectors is to aggregate or combine the elements of the stream into a single summary result, which is the average of the elements. A key feature of the Stream API is its […]

Wayan · 3 min read
JAVA 8 / NOTES</>↗
Java 812 Jan 2024

How do I use Collectors.joining() method?

The Collectors.joining() method is a handy utility in the java.util.stream.Collectors class that provides a Collector which concatenates input elements from a stream into a String. Here are three versions of Collectors.joining(): joining(): Concatenates the input elements, separated by the empty string. joining(CharSequence delimiter): Concatenates the input elements, separated by the specified delimiter. joining(CharSequence delimiter, CharSequence […]

Wayan · 2 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.