列出文件系统根目录
/** 来自 nowjava - 时代Java**/ import java.io.File; public class Main { public static void main(String[] args) { File[] rootDirectories = File.listRoots(); System.out.println("Available root directories in filesystem are : "); for (int i = 0; i < rootDirectories.length; i++) { System.out.println(rootDirectories[i]); } } }