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 / NOTES{ }↗
Java22 Oct 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 min read
JAVA / NOTES{ }↗
Java21 Oct 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 min read
JAVA / NOTES{ }↗
Java21 Oct 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 min read
JAVA / NOTES{ }↗
Java20 Oct 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 min read
JAVA / NOTES{ }↗
Java20 Oct 2025

How do I use Collectors::teeing in Streams?

In Java, Collectors::teeing is a feature introduced in Java 12 that allows you to collect elements of a stream using two different collectors and then combine the results using a BiFunction. Syntax: static <T, R1, R2, R> Collector<T, ?, R> teeing(Collector<? super T, ?, R1> downstream1, Collector<? super T, ?, R2> downstream2, BiFunction<? super R1, […]

Wayan · 3 min read
JAVA / NOTES{ }↗
Java19 Oct 2025

How do I use List.of, Set.of, and Map.of factory methods?

The List.of, Set.of, and Map.of factory methods were introduced in Java 9 to create immutable collections in a simpler and more concise way. These methods directly create unmodifiable instances of List, Set, or Map. Usage of List.of The List.of method is used to create an unmodifiable List containing the provided elements. The key characteristics are: […]

Wayan · 3 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.