Java tutorial
import java.io.File; public class Main { public static void main(String[] args) { // returns pathnames for files and directory File[] paths = File.listRoots(); // for each pathname in pathname array for (File path : paths) { // prints file and directory paths System.out.println(path); } } }