Example code using System.err instead of System.out · Issue #268 · java/devjava-content
Repository navigation
Example code using System.err instead of System.out #268
New issue
New issue
Open
Open
Example code using System.err instead of System.out #268
Description
@authentictech's profile authentictech opened on Aug 4, 2026In Tutorials > The Java I/O API > File System Basics > Creating and Reading Directories, section "Listing a File System's Root Directories", the code prints to System.err instead of System.out when it is not printing an error.
Iterable<Path> dirs = FileSystems.getDefault().getRootDirectories();
for (Path name: dirs) {
System.err.println(name);
}