import java.io.File; /** list - lists all files+dir in top-level of input directory */ public class main { public static void main(String[] args) { File[] files = new File("input").listFiles(); if (files != null) for (File f : files) { System.out.println(f.getName()); } } }