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.

UTIL PACKAGE / CATATAN</>
Util Package29 Okt 2025

How do I use Map.Entry comparingByValue for sorting?

To use Map.Entry.comparingByValue for sorting a Map, you can leverage Java Streams, which provide an efficient way to process and sort collection data. Here’s how the process works: Retrieve the entrySet of the Map: This gives a set of Map.Entry objects that you can operate on with a stream. Sort using Map.Entry.comparingByValue: Use Stream.sorted() along […]

Wayan · 3 menit baca
UTIL PACKAGE / CATATAN</>
Util Package29 Okt 2025

How do I use Collectors.mapping() for nested transformation?

In Java’s Stream API, Collectors.mapping is a collector that applies a mapping function to the input elements before collecting the results. It is often used as part of nested transformations, where one wants to apply a specific transformation on elements that are part of a more complex collector, such as a groupingBy. Syntax of Collectors.mapping […]

Wayan · 4 menit baca
JAVA 17 / CATATAN</>
Java 1728 Okt 2025

How do I use Collectors.partitioningBy?

The Collectors.partitioningBy is a method in Java’s java.util.stream.Collectors class that is used to partition elements of a stream into two groups based on a predicate. It essentially creates a Map with a boolean key (true or false) and lists of elements as values. Here’s an explanation of how to use it effectively: Syntax: Collectors.partitioningBy(Predicate<? super […]

Wayan · 3 menit baca
JAVA 11 / CATATAN</>
Java 1128 Okt 2025

How do I collect stream results into an immutable collection?

In Java, you can use the Stream API’s Collectors to gather stream results into an immutable collection. Since Java 10, you can use Collectors.toUnmodifiableList(), Collectors.toUnmodifiableSet(), and other similar methods to collect the results into unmodifiable collections. Here’s how you can collect the stream results into an immutable collection: 1. Immutable List To collect the results […]

Wayan · 3 menit baca
BASIC / CATATAN</>
Basic27 Okt 2025

How do I use Map.merge() to simplify counting logic?

The Map.merge method in Java is a convenient way to simplify various kinds of logic that require updating or modifying values in a map, such as counting occurrences. It works by letting you specify how to combine the old value (if it exists) and the new value (to be added). This is particularly useful for […]

Wayan · 3 menit baca
UTIL PACKAGE / CATATAN</>
Util Package26 Okt 2025

How do I use ConcurrentHashMap.computeIfAbsent safely?

To safely use ConcurrentHashMap.computeIfAbsent, it’s important to understand both its purpose and how to use it in a thread-safe manner. Purpose of computeIfAbsent computeIfAbsent is a method of ConcurrentHashMap that: Checks if the key exists in the map. If the key exists, it returns the associated value. If the key does not exist, it computes […]

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.