Created
September 30, 2013 22:45
-
-
Save level09/6771422 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
public class ListFiles | |
{ | |
public static void main(String[] args) | |
{ | |
// Directory path here | |
String path = "."; | |
String files; | |
File folder = new File(path); | |
File[] listOfFiles = folder.listFiles(); | |
for (int i = 0; i < listOfFiles.length; i++) | |
{ | |
if (listOfFiles[i].isFile()) | |
{ | |
files = listOfFiles[i].getName(); | |
System.out.println(files); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment