File[] drives = File.listRoots(); // Get list of names for (int i=0; i<drives.length; i++) System.out.println(drives[i]); // Print the list