/** * This method reads in a string and converts the string into an integer * and * returns that integer to the caller of this method. */ private int readInteger() { String userInput = ""; int temp = 0; BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in), 1); try { userInput = stdin.readLine(); temp = Integer.parseInt(userInput); // convert to integer } catch (IOException ex) { System.out.println(ex); } return temp; } // end readInteger