To extract the file system root directories as an array of File - Java File Path IO

Java examples for File Path IO:File System

Description

To extract the file system root directories as an array of File

Demo Code

import java.io.File;

public class Main {
  public static void main(String[] args) {
    File[] roots = File.listRoots();
    for (File root : roots) {
      System.out.println(root);/*ww w . ja  v a2  s. c  o m*/
    }

  }
}

Related Tutorials