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 814 Jan 2024

How do I use String.join() method in Java?

The String.join() method in Java is a static method added in Java 8 to the java.lang.String class. The String.join() is a static utility method used to concatenate multiple strings, arrays or collections (like lists and sets) of strings. This method makes it easier to join multiple strings with a specific delimiter. A delimiter is a […]

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

How do I use java.util.Optional class?

The java.util.Optional<T> class is a container object that may or may not contain a non-null value. It was introduced in Java 8 as part of the Java language’s growing emphasis on treating null values as an anti-pattern. Optional is a way of replacing a nullable T reference with a non-null but potentially empty Optional<T> reference. […]

Wayan · 5 menit baca
JAVA 8 / CATATAN</>
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 menit baca
JAVA 8 / CATATAN</>
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 menit baca
JAVA 8 / CATATAN</>
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 menit baca
JAVA 8 / CATATAN</>
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 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.