title: Setting generic types of SwingWorker as void?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/10839042/what-is-the-difference-between-java-lang-void-and-void">What is the difference between java.lang.Void and void?</a>  </p>
  </blockquote>
  
  
  
  <p>I wanted to create a concrete class for <code>SwingWorker</code> with both final and intermediate result types as <code>void</code>. I wrote the following code:</p>
  
  <pre><code>class AnswerWorker extends SwingWorker&lt;void, void&gt; {
      protected void doInBackGround() {
          System.out.println("what is your problem!!");
      }
  }
  </code></pre>
  
  <p>This gave me the following error:</p>
  
  <pre><code>Multiple markers at this line-
      Syntax error on token "void", Dimensions expected after this token.
      Syntax error on token "void", Dimensions expected after this token.
  </code></pre>
  
  <p>However when i changed the code from <code>void</code> to <code>Void</code> (i.e. small <code>v</code> to capital <code>V</code>), it worked fine, although I was still forced to <code>return null;</code> at the end of <code>doInBackground()</code> method.</p>
  
  <p>Why is this? I know <code>Void</code> is a class in <code>java.lang</code> package but the documentation doesn't says much about it (atleast not which i could follow :p)</p>
  
  <p>Thanx in advance!!</p>