title: Java 8 Method expression is giving compilation error
body: <p>I am new to Java 8 (Lambda Expression). The following piece of code prints all the directories at the path indicated by the variable "file".</p>
  
  <pre><code>File file = new File("/vssexclude/Test/workspace/Test");
  
  File[] names = file.listFiles(fileName -&gt; fileName.isDirectory());
  
  for (File name : names) {
      System.out.println(name.toString());
  }
  </code></pre>
  
  <p>But, when I try to replace the lambda expression with method expression, eclipse is giving compilation error:</p>
  
  <pre><code>File[] names = file.listFiles(File::isDirectory());
  </code></pre>
  
  <p>What am I missing?</p>