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!
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
Rocket Oven Kickstarter - from the trailboss

This thread has been viewed 497 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jul 19, 2018 20:41:00.