81,094
社区成员
发帖
与我相关
我的任务
分享
import javax.swing.filechooser.FileSystemView;
public class Test01 {
public static void main(String[] args) throws IOException {
FileSystemView fs = FileSystemView.getFileSystemView();
File[] roots = File.listRoots();
for(int i = 0; i < roots.length; i++) {
System.out.println(roots[i].getCanonicalPath() + " --> " +
fs.getSystemTypeDescription(roots[i]));
}
}
}