システム内のすべてのシステムドライブをリストする方法 getdocs 4年前 例 package com.mkyong.io; import java.io.File; public class App{ public static void main (String args[]) { File[]rootDrive = File.listRoots(); for(File sysDrive : rootDrive){ System.out.println("Drive : " + sysDrive); } } } 出力 Drive : A:\ Drive : C:\ Drive : D:\ Drive : E:\ io java