Possible Duplicate:
What is the difference between java.lang.Void and void?
I wanted to create a concrete class for SwingWorker
with both final and intermediate result types as void
. I wrote the following code:
class AnswerWorker extends SwingWorker<void, void> {
protected void doInBackGround() {
System.out.println("what is your problem!!");
}
}
This gave me the following error:
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.
However when i changed the code from void
to Void
(i.e. small v
to capital V
), it worked fine, although I was still forced to return null;
at the end of doInBackground()
method.
Why is this? I know Void
is a class in java.lang
package but the documentation doesn't says much about it (atleast not which i could follow :p)
Thanx in advance!!