Schematic of the a computer system that is running a Java program looks like this:
Java program has to talk through all these layers to hardware in order to read from the keyboard or write to the display. I/O is a little more complicated than previous constructions:
import java.io.*;
class Test {
private static BufferedReader in;
public static void main(String[] args) throws IOException {
InputStreamReader k = new InputStreamReader(System.in);
in = new BufferedReader(k);
String il = in.readLine();
System.out.println("il = " + il);
}
}
What does this do?
See the corrections to the lecture I gave on this topic.
More coming in this section: stuff about parseInt, parseDouble, what InputStreamReader and BufferedReader do, a brief explanation of exception handling