I have a lambda expression of type FileFilter that returns true for all files ending with .java -
FileFilter lambdaFilter = (File pathname) -> pathname.getName().endsWith(".java");
I want to use Method reference for above expression. My unsuccessful attempt -
FileFilter lambdaFilter = File::getName.endsWith(".java");
Is it possible to use Method Reference for above case? How?
You can do chaining this way
But not in a single operation