Return | Method | Summary |
---|---|---|
static File[] | listRoots() | List the available filesystem roots. |
import java.io.File;
public class Main {
public static void main(String[] args) {
File[] roots = File.listRoots();
for(File root: roots){
System.out.println(root);
}
}
}
The output:
C:\
D:\
java2s.com | Contact Us | Privacy Policy |
Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
All other trademarks are property of their respective owners. |