Java Java Keyboard Reader: V1.3 to Newest Version

  • Thread starter Thread starter thharrimw
  • Start date Start date
  • Tags Tags
    Java
AI Thread Summary
The discussion centers on troubleshooting issues with a Java program that uses a custom class called "KeyboardReader" for input. The original poster is learning Java and is trying to implement a keyboard reader from a book that is outdated, specifically for Java version 1.3, while using a newer version. The key point raised is that "KeyboardReader" is not a standard Java class, meaning it must be defined separately in its own file, "KeyboardReader.java," for the program to compile and run correctly. Additionally, participants emphasize the importance of providing specific error messages to diagnose issues effectively. The conversation highlights the need to ensure compatibility between the code and the version of Java being used, as well as the necessity of understanding the components of the code being implemented.
thharrimw
Messages
114
Reaction score
0
I have recently started to try to teach myself java and i can't get the keybord reader to work.
I'm a book thet's for java V1.3 but I'm using the newest version is that the problem? unless the book was wong then my program syntax should be fine. could anyone tell me what the syntax for the keybord reader is?
 
Technology news on Phys.org
BufferedReader in
= new BufferedReader(new InputStreamReader(System.in));

I believe this is what you need. Are you planning to run your program using the cmd or gui?
 
cmd it's just a basic temp. converting program. I'm not used to jave I've only programmed on my ti 83+, 89T, and Nspier
 
if i copy and past my program could you show me what's wrong? the book that i have is fron 2004 so i don't know if it's syntax is out of date or not.
 
Sure...you could copy and paste it here. I take a look at it. See what's up.

FYI: I'm a intermediate java and c++ programmer.
 
ImputTerminalIO.KeyboardReader
public class converter {
public static void main(String [] args) {
KeyboardReader reader = new KeyboardReader();
double f;
double c;

System.out.print("enter F: ");
f =reader.readDouble();

c = (f-32.0)*5.0/9.0;

System.out.println("The equivalent in c is ");

reader.pause();
}
}
 
that's exactly as it was in my java book.
 
You need to tell us EXACTLY what's happening -- what error messages you're seeing, etc. -- not just "I can't get it to work."

The "KeyboardReader" is not a standard part of the Java programming language. If the KeyboardReader was provided in your book, you need to also type that into a file called "KeyboardReader.java" and compile it along with your own program.

- Warren
 

Similar threads

Back
Top