import java.io.File; import java.io.IOException; public class List{ public static void main(String[] args){ File f = new File("f:"+File.separator+"Myfile"+File.separator); String list[] = f.list; for(int i=0;i<list.length;i++) System.out.println(list[i]); } }