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.

IO / NOTES</>↗
IO30 Dec 2025

How do I use NIO Path.of() instead of Paths.get()?

In Java 11 and later, Path.of() is the preferred way to create Path instances, effectively replacing Paths.get(). Here is how you can use it: 1. Basic Usage (Replacing Paths.get) The syntax is almost identical. It accepts a string or a sequence of strings to join into a path. package org.kodejava.nio; import java.nio.file.Path; public class PathExample […]

Wayan · 2 min read
IO / NOTES</>↗
IO29 Dec 2025

How do I use Files.mismatch() to compare files?

In Java, java.nio.file.Files.mismatch(Path, Path) is a powerful method introduced in Java 12 that allows you to compare the contents of two files efficiently. It returns the position of the first byte where the two files differ, or -1L if they are identical. How to use Files.mismatch Here is a basic example of how to implement […]

Wayan · 2 min read
IO / NOTES</>↗
IO28 Dec 2025

How do I read and write files with Files.readString() and Files.writeString()?

In Java, Files.readString and Files.writeString (introduced in Java 11) are the most straightforward ways to handle small-to-medium-sized text files. They handle the opening, closing, and encoding for you in a single line of code. Here is how you can use them: 1. Reading a File to a String Files.readString(Path) reads the entire content of a […]

Wayan · 2 min read
CONCURRENCY / NOTES</>↗
Concurrency27 Dec 2025

How do I debug concurrency issues effectively?

Debugging concurrency issues (like deadlocks, race conditions, and thread starvation) can feel like chasing ghosts because they are often non-deterministic. Here’s a strategy to tackle them effectively using both design patterns and tools available in your environment. 1. Give Your Threads Meaningful Names The default pool-1-thread-1 names are useless in a thread dump. By using […]

Wayan · 3 min read
CONCURRENCY / NOTES</>↗
Concurrency26 Dec 2025

How do I create custom thread factories?

Creating a custom thread factory in Java is a powerful way to manage how threads are initialized. Instead of using the default factory, you can customize thread names (vital for debugging!), set priority levels, or even create daemon threads. To do this, you need to implement the java.util.concurrent.ThreadFactory interface. 1. Implement the ThreadFactory Interface The […]

Wayan · 2 min read
CONCURRENCY / NOTES</>↗
Concurrency25 Dec 2025

How do I use ExecutorService.invokeAll?

Hello! ExecutorService.invokeAll is a powerful method when you have a collection of tasks and need to wait until every single one of them finishes before moving forward. Here’s a breakdown of how it works and how to use it effectively. What does invokeAll do? Executes a collection of tasks: It takes a Collection of Callable<T> […]

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.