title: What does "Incompatible types: void cannot be converted to ..." mean?
body: <p>What does the Java compilation message:</p>
  <pre><code>&quot;Incompatible types: void cannot be converted to ...&quot; 
  </code></pre>
  <p>mean, and how do I fix it.  Some compilers use different wording; e.g.</p>
  <pre><code>&quot;Type mismatch: cannot convert from void to ...&quot;
  </code></pre>
  <p>or</p>
  <pre><code>&quot;Incompatible types. Required: ... found: void&quot;
  </code></pre>
  <p>or</p>
  <pre><code>&quot;Incompatible types: Found void, required ...&quot;
  </code></pre>
  <p><em>(This is intended to be a canonical Q&amp;A for some very specific compilation error messages involving &quot;void&quot; that tend to confuse new Java programmers.  It is not intended to be a tutorial on the various different &quot;type conversion&quot; problems that one can encounter in Java.)</em></p>