Originally Posted by
titowinky
Thank you Tim. I figured that out yesterday after a colleague pointed it to me. I should have declared the value first before using it.
As a Java programming enthusiast, I was expecting people to help me in this forum because I can't figure it out myself. If I could, I would have not ask anybody. But each time I ask question here people will reply: if you want help do this first, read this, etc. I would have wanted to but I don't have the luxury of time. Of course you learn from books but it's easier to learn from some experienced guy.
Thanks again Tim.
We ask you for an SSCCE and to do some basic debugging for several reasons. First off, many questions here are homework, so just giving out answers is just like doing somebody's homework for them. It teaches them nothing, and will actually end up hurting them for the reasons listed here:
http://www.javaprogrammingforums.com...n-feeding.html
Secondly, and more applicable in this situation, the code that people post is often NOT indicative of their actual problem. Tim had a good guess this time around, but I should point out that if we ran the code that you actually posted, it would result in a completely different compiler error. So either that code is different from the code you're running (in which case all bets are off) or you're incorrect about the compiler error (in which case you need to take a closer look at the code and error message). Both of these problems are solved by asking you to do some basic debugging and posting an SSCCE for us to look at. If you can't take the 5 minutes to do that, you can't really be that indignant that people aren't helping you, for free, in their spare time, just because they don't automatically do it for you.