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 8 / NOTES</>↗
Java 808 Jan 2024

How do I use Stream.generate() method?

The Stream.generate() method in Java is used to create an infinite stream of data, typically used when the programmer needs a limitless supply of data to be processed. Here’s an example of how you might use Stream.generate(): package org.kodejava.util; import java.util.stream.Stream; public class StreamGenerate { public static void main(String[] args) { Stream<String> stringStream = Stream.generate(() […]

Wayan · 2 min read
JAVA 8 / NOTES</>↗
Java 808 Jan 2024

How do I split a string using Pattern.splitAsStream() method?

Pattern.splitAsStream() in Java is a method that allows us to split a string into a stream of substrings given a regex pattern. This can be useful when we’re working with large strings, and we want to process the substrings in a functional style using Java Streams. Here’s a basic example of how you can use […]

Wayan · 3 min read
IO / NOTES</>↗
IO08 Jan 2024

How do I use Files.walk() method to read directory contents?

The Files.walk() method in Java is a handy method when it comes to reading directory contents. Files.walk() method returns a Stream object that you can use to process each of the elements (files or directories) in the directory structure. This method walks the file tree in a depth-first manner, starting from the given path that […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API08 Jan 2024

How do I list files in a given directory using Files.list() method?

In Java, you can use the Files.list() method to list all files in a given directory. Files.list(Path dir) is a method in the java.nio.file.Files class. This method returns a Stream that is lazily populated with Path by walking the directory tree rooted at a given starting file. The file tree is traversed depth-first, the elements […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API08 Jan 2024

How do I use BufferedReader.lines() method to read file?

The BufferedReader.lines() method is a Java 8 method that returns a Stream, each element of which is a line read from the BufferedReader. This allows you to perform operations on each line with Java’s functional programming methods. Returning a Stream of strings makes the BufferedReader.lines() method very efficient in terms of memory usage when working […]

Wayan · 2 min read
JAVA 8 / NOTES</>↗
Java 807 Jan 2024

What is Java Stream API?

The Java Stream API is a powerful tool introduced in Java 8. It is designed to process data in a declarative way. More specifically, it makes it easy to process sequences of data elements, such as collections or arrays. Here are some key points about Java Stream API: Non-mutating: Operations on streams do not mutate […]

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