A break prevents a 'fall through' to the next case item. The break is not required here for two reasons:
- The option in question is the last item in the
switch statement so there is nothing to fall through to
- Even if there was another item below, it will never 'fall through' anyway, as
System.exit() does not return as it terminates the application (+/- various hooks)
Perhaps the question means 'does System.exit() ever return?' (in which case if it were not the last item in a switch statement, a break might be required).
According to the documentation:
[System.exit()] Terminates the currently running Java Virtual Machine. The argument serves as a status code; by convention, a nonzero status code indicates abnormal termination. This method calls the exit method in class Runtime. This method never returns normally.
The call System.exit(n) is effectively equivalent to the call: Runtime.getRuntime().exit(n)
I don't much like that 'normally'. Runtime.exit has the same 'normally'. I suspect this is however a reference to the fact they can throw an exception, in which case the absence of a break is not an issue. Jon Skeet does not appear to be concerned about it here.
That said, there is nothing to prevent you putting the break statement there. Indeed it may be a good plan in case someone adds another item after, then someone else swaps System.exit() for something that might return, e.g. a call to something saying 'Are you sure you want to quit'?