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 / CATATAN{ }
Java23 Okt 2025

How do I use Stream.takeWhile() and Stream.dropWhile()?

In Java, the Stream.takeWhile and Stream.dropWhile methods are introduced in Java 9. These operations allow you to process a stream conditionally based on a predicate, controlling how many elements to take or discard from the stream. Here’s how they work: Stream.takeWhile(predicate) Operation: This method takes elements from the stream as long as the given predicate […]

Wayan · 3 menit baca
JAVA / CATATAN{ }
Java22 Okt 2025

How do I filter and map a stream effectively?

Filtering and mapping a stream effectively typically involves three main operations: filtering the elements that meet a specific condition, transforming the elements into another form (mapping), and processing them (e.g., collecting or printing). Here’s an explanation of how to do it effectively, based on the information provided (and generally applicable): 1. Filter The filter method […]

Wayan · 4 menit baca
JAVA / CATATAN{ }
Java22 Okt 2025

How do I use Objects.checkIndex() for safe index validation?

Objects.checkIndex, introduced in Java 11, is a utility method for safely validating an index against a given range. It simplifies index validation by throwing well-defined exceptions with meaningful error messages if the index is out of bounds. Syntax public static int checkIndex(int index, int length) index: The index to check. length: The upper bound (exclusive) […]

Wayan · 2 menit baca
JAVA / CATATAN{ }
Java21 Okt 2025

How do I use String.indent() to format output text?

The String.indent(int n) method in Java is a useful tool for formatting multi-line strings by adjusting the amount of leading space (indentation) on each line. Introduced in Java 12, it performs the following for the specified n indentation: Positive n: Adds n spaces to the beginning of each line in the string. Negative n: Removes […]

Wayan · 2 menit baca
JAVA / CATATAN{ }
Java21 Okt 2025

How do I use Stream.toList() instead of collect(Collectors.toList())?

In Java 16, a convenient method Stream.toList() was introduced to simplify collecting elements of a Stream into a List. It provides a more concise alternative to collect(Collectors.toList()), which was used in older versions of Java. Key Differences Stream.toList() produces an immutable list, whereas collect(Collectors.toList()) produces a mutable list. Stream.toList() guarantees immutability, meaning the resulting list […]

Wayan · 2 menit baca
JAVA / CATATAN{ }
Java20 Okt 2025

How do I use Predicate.not() in Streams?

To use Predicate.not() in streams, you take advantage of its ability to negate an existing predicate. This can be helpful in filter operations where you want to filter out elements that match a given condition instead of including them. Here’s how you can use Predicate.not in streams: Basic Explanation What it does: The Predicate.not() method […]

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.