Created
September 20, 2018 01:26
-
-
Save JoeUX/cfab4cd934a4c4afee1180ed2e333bee to your computer and use it in GitHub Desktop.
Java example
This file contains 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
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