• 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

Hey can I have a little help understanding symbols?

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! I'm new here, and this is my first post. I was hoping to get some help understanding the cannot find symbol error. I'm attempting to teach myself java using just my computer and a textbook called Head First Java that my school supplied to shut me up. If you could take a look at this code, copied from page 106, and tell me why I'm getting this error and what exactly it means so I can troubleshoot it in the future:

Code:




And here's the error that happens when I attempt to compile it

SimpleDotCom.java:8: error: cannot find symbol
int guess = Interger.parseInt(stringGuess);
^
symbol: variable Interger
location: class SimpleDotCom
1 error

(The carrot in the window is pointing to the I in Interger.parseInt)
Thanks In advance!
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Cody Prince wrote:
And here's the error that happens when I attempt to compile it




Basically, it is saying that it doesn't know what "Interger" is.... perhaps you mean "Integer" (without the "r")??

Henry
 
Cody Prince
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't facepalm any harder.
 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch
I have added code tags to your post, which you should always use, and you can see how much better it looks
You should never use tabs for indenting. Always use spaces. If you get a decent text editor, you can set up options to do that automatically.
 
Cody Prince
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you! What would constitute as a decent text editor? At the moment I'm using notepad, because that's all I actually have on my laptop. Also, should I use the code for whatever errors the compiler is giving me as well?
 
Ranch Hand
Posts: 42
Netbeans IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Personally I would say, yes, use the code tags for the error messages as well as the code. It formats it for you and makes it easier to read in my opinion. I don't know if the moderators of the forums would require it, but if they do I'm sure you can probably find a thread on posting rules somewhere.

Also I use notepad++ as a text editor. I don't know if it is what Campbell Ritchie means by saying "decent text editor", but it's what I use.
 
Campbell Ritchie
Marshal
Posts: 79179
377
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have to beware of code tags for error messages; if the line is long, it creates left‑and‑right scroll bars, and the thread becomes very difficult to read.
Notepad is dreadful for programming; Notepad++ is excellent, however.
More comments here, here and here; those links say more or less the same thing. Remember to write backwards.
 
The City calls upon her steadfast protectors. Now for a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic