Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cannot find symbol

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm new to Java and relatively new to programming in general. Currently I'm reading the book 'Head First Java' and am stuck on this piece of code from chapter two.

Every time I try to compile it, it comes up with an error.

Anyway, here's the code:








I type javac *.java to compile it
And here's the error it keeps throwing up:

GuessGame.java:48: error: cannot find symbol
if (p1isright || p2isright || p3isright) {
^
symbol: variable p1isright
location: class GuessGame
GuessGame.java:48: error: cannot find symbol
if (p1isright || p2isright || p3isright) {
^
symbol: variable p2isright
location: class GuessGame
GuessGame.java:48: error: cannot find symbol
if (p1isright || p2isright || p3isright) {
^
symbol: variable p3isright
location: class GuessGame
GuessGame.java:51: error: cannot find symbol
System.out.println("Player one got it right?" + p1isright);
^
symbol: variable p1isright
location: class GuessGame
GuessGame.java:52: error: cannot find symbol
System.out.println("Player two got it right?" + p2isright);
^
symbol: variable p2isright
location: class GuessGame
GuessGame.java:53: error: cannot find symbol
System.out.println("Player three got it right?" + p3isright);
^
symbol: variable p3isright
location: class GuessGame
6 errors

Any help would be appreciated.
Thanks!
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
java is case sensitive
 
Jacob Milligan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm... Well I feel a bit silly now. I didn't even notice that.

Thanks!
 
Marshal
Posts: 79027
375
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch Lots of people get confused like that.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic