Skip to content

Instantly share code, notes, and snippets.

@JoeUX
Created September 20, 2018 01:26
Show Gist options
  • Save JoeUX/cfab4cd934a4c4afee1180ed2e333bee to your computer and use it in GitHub Desktop.
Save JoeUX/cfab4cd934a4c4afee1180ed2e333bee to your computer and use it in GitHub Desktop.
Java example
package com.java2novice.files;
import java.io.File;
public class FilesListFromFolder {
public static void main(String a[]){
File file = new File("C:/MyFolder/");
File[] files = file.listFiles();
for(File f: files){
System.out.println(f.getName());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment