import java.io.*; class goofy { public static void main (String [] args) { InputStreamReader nab = new InputStreamReader(System.in); BufferedReader grab = new BufferedReader(nab); int x = 2; int y; int z; System.out.println("Please enter an integer."); try { y = Integer.parseInt(grab.readLine()); System.out.println("Thanks for entering the number " + y); } catch (NumberFormatException e) { y = 0; // TODO Auto-generated catch block System.out.println("Sorry, that didn't make any sense!"); //e.printStackTrace(); } catch (IOException e) { y = 9; // TODO Auto-generated catch block //System.out.println("Sorry, I can't read things today!"); e.printStackTrace(); } z = x + y; System.out.println("The answer to "+x+" + "+y+" is = " + z); } }