title: How to write lambda expression with EventHandler javafx
body: <p>I'm trying to rewrite this code</p>
  
  <pre><code>new EventHandler&lt;MouseEvent&gt;() {
  
      @Override
      public void handle(MouseEvent e) {
          System.out.println(e.hashCode());
      }
  };
  </code></pre>
  
  <p>as</p>
  
  <pre><code>new EventHandler&lt;MouseEvent&gt;(e -&gt; System.out.println(e.hashCode()));
  </code></pre>
  
  <p>and I get errors. What is my mistake here?</p>