• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot find symbol error  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

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..

Thanks!
 
Bartender
Posts: 2087
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Manolis Tsilikidis
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, you are right...did not intend to declare it inside the loop...thanks a lot!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!