File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Hey can I have a little help understanding symbols? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Hey can I have a little help understanding symbols?" Watch "Hey can I have a little help understanding symbols?" New topic
Author

Hey can I have a little help understanding symbols?

Cody Prince
Greenhorn

Joined: Oct 29, 2012
Posts: 7
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!
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18966
    
  40

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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Cody Prince
Greenhorn

Joined: Oct 29, 2012
Posts: 7
I can't facepalm any harder.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39773
    
  28
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

Joined: Oct 29, 2012
Posts: 7
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?
Alex Petsche
Ranch Hand

Joined: Oct 29, 2012
Posts: 42

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
Sheriff

Joined: Oct 13, 2005
Posts: 39773
    
  28
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hey can I have a little help understanding symbols?