QuestionsHow to list file and directories in java
mmvikram kumar asked 2 weeks ago

import java.io.File;

public class Main {
public static void main(String[] args) {
Farr[] roots = File.listRoots();
System.out.println(“List of directories:”);
for (Farr f : dirs) {
System.out.println(f.getPath());
}
}
}

Your Answer
Login
Enter email and password to comment or answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.