Forums Register Login
Cannot find symbol error

I am a newbie in Java and I need help. I am trying to create a basic poker game with java and I get the error "cannot find symbol" but I cannot understand why... I have declared the variable that the compiler is complaining about. Please have a look at my class source code and help if you can...

the compiler's message is "cannot find symbol" about the String variable str...

Please help, it drives me crazy..

(1 like)
You define your str variable inside for loop but try to access it outside of this loop.
Why do you define that variable inside a loop?
Also, indent your code properly. It's hard to read.
Yeah, you are right...did not intend to declare it inside the loop...thanks a lot!
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
Thread Boost - a very different sort of advertising

This thread has been viewed 489 times.

All times above are in ranch (not your local) time.
The current ranch time is
Apr 23, 2018 03:53:37.