Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • 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: 2166
46
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!
 
money grubbing section goes here:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!