title: What do I return if the return type of a method is Void? (Not void!)
body: <p>Due to the use of Generics in Java I ended up in having to implement a function having <code>Void</code> as return type:</p>
  
  <pre><code>public Void doSomething() {
      //...
  }
  </code></pre>
  
  <p>and the compiler demands that I return <em>something</em>. For now I'm just returning <code>null</code>, but I'm wondering if that is good coding practice...</p>
  
  <p>I'm asking about <strong>V</strong>‌oid, not <strong>v</strong>‌oid. The class <code>Void</code>, <strong>not</strong> the reserved keyword <code>void</code>.</p>
  
  <p>I've also tried <code>Void.class</code>, <code>void</code>, <code>Void.TYPE</code>, <code>new Void()</code>, no return at all, but all that doesn't work at all. (For more or less obvious reasons) (See <a href="https://stackoverflow.com/questions/676663/what-do-i-return-if-the-return-type-of-a-method-is-void-not-void/881358#881358">this answer</a> for details)</p>
  
  <ul>
  <li>So what am I supposed to return if the return type of a function is <code>Void</code>? </li>
  <li>What's the general use of the <code>Void</code> class?</li>
  </ul>