title: Java Streams : Using println with map and forEach
body: <p>I started working with streams and facing below issue:</p>
  
  <pre><code>ArrayList&lt;Integer&gt; al = new ArrayList&lt;Integer&gt;();
  al.add(10);
  al.add(20);
  al.add(30);
  
  al.stream().forEach(System.out::println); // This works
  
  al.stream().map(System.out::println); // This fails with error as "Incompatible types: expected not void but compile-time declaration for method reference has void return type"
  </code></pre>
  
  <p>Can someone please explain this?</p>