Throw IOException not compiling [message #1384957] |
Tue, 03 June 2014 05:53  |
Eclipse User |
|
|
|
Hello,
I am currently working through a Java Beginners Guide (5th edition on amazon, should popo right out), so I have downloaded the Java development Kit, and also the Eclipse program. And I've stumbled upon a problem:
public class KbIn {
public static void main(String args[]) {
throws IOException; {
char ch;
System.out.print("Press a key followed by Enter: ");;
ch = (char) System.in.read();
System.out.println("Your key is: " + ch);
}
}
}
The book tells me that this code should compile, but I get a "IOException cannot be resolved to a variable" error. How do I fix this issue?
Best,
Michal
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04365 seconds