public class Adding extends MiniJava {
    public static void main(String[] args) {
	int x = getInt("1. Zahl:\t");
	int y = getInt("2. Zahl:\t");
	write("Summe:\t\t" + (x+y));
    } // end of main()
    public static int getInt(String str) {
//continued...
	String s;
	while (true) {
	    try {
		s = readString(str);
		return Integer.parseInt(s);
	    } catch (NumberFormatException e) {
		System.out.println(
		     "Falsche Eingabe! ...");
	    } catch (NullPointerException e) {
		System.out.println(
		     "Eingabeproblem: Ende ...");
		System.exit(0);
	    }
	} // end of while
    } // end of getInt()
} // end of class Adding
