title: How to assign a reference of `System.out.println` to a variable?
body: <p>I want to assign the reference to variable p:</p>
  
  <pre><code>Function&lt;?, Void&gt; p = System.out::println; // [1]
  </code></pre>
  
  <p>so that I can use it like:</p>
  
  <pre><code>p("Hello world"); // I wish `p` to behave exactly same as `System.out.println`
  </code></pre>
  
  <p>Expression [1] produce a compilation error, how to resolve it?</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.Error: Unresolved compilation problem: </p>
    
    <p>The type of println(Object) from the type PrintStream is void, this is incompatible with the descriptor's return type: Void</p>
  </blockquote>
  
  <p>If change <code>Void</code> to <code>void</code> the error becomes:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
        Syntax error, insert "Dimensions" to complete ReferenceType</p>
  </blockquote>