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 Cannot Resolve Symbol (Keyboard.readInt()) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Cannot Resolve Symbol (Keyboard.readInt())" Watch "Cannot Resolve Symbol (Keyboard.readInt())" New topic
Author

Cannot Resolve Symbol (Keyboard.readInt())

Roman Sorokin.
Greenhorn

Joined: Oct 24, 2003
Posts: 2
This is a beginner section, right? Well if it is, then here is my beginner's question. In a java code (as follows) why Keyboard.readInt() gets a "cannot resolve symbol" error message? Thanks in advance to all who answers.

Java code:

class Temperature {
public static void main (String[] args) {
int temperature;

System.out.print("Please type in the temprature you wish to convert (deg F): ");
temperature = Keyboard.readInt();
System.out.print(" deg F is ");
System.out.print(temperature);
System.out.print((5.0 * (temperature - 32.0)) / 9.0);
System.out.println(" deg C ");

}

}
[ October 24, 2003: Message edited by: R. S. ]
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
did you implement a Keyboard class (or maybe added external
package)?? Cause in standard J2SE there this class doesn't exist.
Maybe this is why he cannot resolve symbol. But it would be helpful
if you post the complete exception.
[ October 24, 2003: Message edited by: Oliver Refle ]
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
Welcome to JavaRanch "R. S."
Your display name doesn't quite fit the famous JavaRanch naming policy. Could you please take a minute to change your display name to show 2 names, preferably your real name. (It's all about maintaining our professional image - don't let the one-eyed moose fool you!).
Thanks and hope you'll be visiting the ranch often,
Pauline
chris czinder
Greenhorn

Joined: Oct 02, 2002
Posts: 28
R.S.
I've had the same class as you, or atleast used the Keyboard.java file, I think you are using.
You need to make sure you have the Keyboard.java file, and the Temperature.java file in the same directory and it should work.
I compiled the code and it ran fine for me, though you may want to shorten the end output to perhaps 2 decimals, using the abilities of Keyboard. If you need more help, just ask.
Roman Sorokin.
Greenhorn

Joined: Oct 24, 2003
Posts: 2
Thanks to all who replyed to my posted message. As of now I am working on fixing the problem. I'll post the results.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot Resolve Symbol (Keyboard.readInt())