It is not enough to declare variables in constructor in order to use them throughout your class. You need to declare them as class fields (outside the constructor), otherwise they just act as local variables for the constructor (or any other block of code).
Edit: Playing around with threads without getting along with scope of variables is a tricky business by my oppinion.
The quieter you are, the more you are able to hear.
In java you got different scopes, class level, method level, etc...
So had you declared these variables in class level, you would not have got the error. But here, you have declared them in constructor, so compiler can see them inside that particular constructor only, and not in other scopes....so you are getting "can not find symbol" error....
Hope that helps.
The biggest gamble will be to ask a question whose answer you know in that it will challenge your theory | www.TechAspire.blogspot.in
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop