This can be done using static method File.listRoots().
Eg.
Eg.
File[] roots = File.listRoots();
System.out.println("Root directories :");
for (int i=0; i < roots.length; i++) {
System.out.println(roots[i].toString());
}
No comments:
Post a Comment