java - From File[] files to directory -
i have problem code: public class files { public static void main(string[] args) throws ioexception { // filter files aaa.txt , bbb.txt another's file f = new file("d:\\dir"); // current directory file f1 = new file("d:\\dir1\\"); filenamefilter textfilter = new filenamefilter() { public boolean accept(file dir, string name) { if (name.startswith("a") && name.endswith(".txt")) { //system.out.println(name); return true; } else if (name.startswith("b") && name.endswith(".txt")) { //system.out.println(name); return true; } else { //system.out.println(name); return false; } } }; file[] files = f.listfiles(textfilt