Exception handling (programming): Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Tags: Mobile edit Mobile app edit iOS app edit App section source
Line 60:
 
if (line.length() == 0) {
throw new EmptyLineExceptionIOException("The line read from console was empty!");
}
 
System.out.printf("Hello %s!\n", line);
System.out.println("The task executed successfully.");
} catch (EmptyLineExceptionIOException e) {
System.out.println("Hello!");
} catch (Exception e) {