Oh crap, I hate subtle mistakes. I make the same mistake sometimes on loops. To indicate an end of a line or piece of code, you use the
; symbol. You do not, however, include that symbol when you are including additional code, like declaring a method or running a loop.
For example, these two loops are not the same:
//Correct
for(int i=0;i<10;i++)
{
...
}
//Incorrect
for(int i=0;i<10;i++);
{
...
}
Why is the second incorrect? It has a
; after it. When you do this, you will receive no error, because the program just treats this as an empty loop. It will run it 10 times and quit.
However, if you make the same mistake on a method or constructor, you will get an error because you have to provide a
body for that method/constructor, and by having the
; you are saying it has no body.
Look at these two method declarations:
//Correct
public void method()
{
...
}
//Incorrect
public void method();
{
...
}
Once again, our pain-in-the-ass
; is ruining it for us. The good news is that when you do this with a method/constructor, you WILL get a compiler error.
Look at the end of your constructor declaration and I'm sure you can find the issue.