//ReadInt.java import java.io.*; //needed for interactive input public class ReadInt { public static void main(String[] args) { int i; while (true) { i = read_int(); System.out.println("i is " + i); } } public static int read_int() { //interactive console input. must import java.io.*; BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); //incantation String line=""; // ="" is kludge to avoid uninitialized error //readLine can throw a checked exception, so must have try catch try { line = in.readLine(); } catch (IOException e) { System.out.println("readline bombed..."); } return Integer.parseInt(line); } } /* what causes readLine to throw exception? */