How to continue execution of a try catch statement in java [duplicate]
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Java: Try-Catch-Continue? I'm reading in information from a text file and I want my code to throw an exception if there is an invalid type being read. However, I can't figure out how to have my program continue after an exception has been found while(input.hasNext()) { try{ type = input.next(); name = input.next(); year = input.nextInt(); } catch(InputMismatchException ex) { //System.out.println("** Error: