User interaction in main If an exception occurs, user can specify another file name boolean done = false; String filename = JOptionPane.showInputDialog( Enter file name ); while (!done) { try { Purse myPurse = new Purse(); myPurse.readFile(filename); System.out.println( total= + myPurse.getTotal()); done =true; }
{}