Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

JAVA 8 / CATATAN</>
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 menit baca
JAVA 8 / CATATAN</>
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 menit baca
JAVA 8 / CATATAN</>
Java 812 Jan 2024

How do I use Collectors.toSet() method?

The Collectors.toSet() method is a method from the java.util.stream.Collectors class that provides a Collector able to transform the elements of a stream into a Set. Here’s an example of using the Collectors.toSet() method: package org.kodejava.stream; import java.util.Arrays; import java.util.List; import java.util.Set; import java.util.stream.Collectors; public class CollectorsToSet { public static void main(String[] args) { List<String> fruits […]

Wayan · 2 menit baca
JAVA 8 / CATATAN</>
Java 812 Jan 2024

How do I use Collectors.toList() method?

The Collectors.toList() method is a convenient method in the java.util.stream.Collectors class that provides a Collector to accumulate input elements into a new List. Here is a simple example of how to use Collectors.toList(): package org.kodejava.stream; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class CollectorsToList { public static void main(String[] args) { List<Integer> numbers = Arrays.asList(1, […]

Wayan · 1 menit baca
JAVA 8 / CATATAN</>
Java 812 Jan 2024

What are collectors in Java Stream API?

In Java, the Collector is a concept in the Stream API which provides a way to collect the results of various operations in the stream. It is used in conjunction with the collect method of the Stream interface. The collect method allows you to accumulate the elements of the stream into a summary result. Here’s […]

Wayan · 3 menit baca
JAVA 8 / CATATAN</>
Java 810 Jan 2024

How do I use sorted method in Java Stream API?

In the Java Stream API, the sorted() method is used to sort elements in a stream. The sorted() method returns a stream consisting of the elements of the original stream, sorted according to natural order. If the elements of the stream are not Comparable, a java.lang.ClassCastException may be thrown when the terminal operation is executed. […]

Wayan · 3 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

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

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.