File.listRoots() will list out all the available
file system roots / drives in your current system.
import java.io.File;
public class SysDrive {
public static void main (String args[]) {
File[] rootDrive = File.listRoots();
for(File sysDrive : rootDrive){
System.out.println("Drive : " + sysDrive);
}
}
}
how to store all these drives in one variable . i want in my project
ReplyDelete