Skip to content

Example code using System.err instead of System.out #268

Description

@authentictech

In 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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions