3 ms·
Lambdas in Java Preview — part I
- yesbabyyes 16y agoI'm a bit tired, but it seems to me like the fileFilter method would look nicer like this: public static File[] fileFilter(File dir, #boolean(File) matcher) { return dir.listFiles(new FileFilter() { public boolean accept(File file) { return matcher.(f); } }); } Or am I way off? I realize that it's moot, with the SAM types support that he's mentioning. Seems pretty nice. On the whole it looks kind of verbose to me, and way uglier than in C#, but Java seems to me to at least be improving.