Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot Resolve Symbol (Keyboard.readInt())

 
Roman Sorokin.
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4012
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to all who replyed to my posted message. As of now I am working on fixing the problem. I'll post the results.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic