any integer will work so that the system can exit. A zero value in exit() will cause no action taken to the error. A non-zero value in exit() will deal with the error using a routine that you need to write.
When you execute any program (eg from a batch file or script) the program returns an integer return code; by convention this is 0 for successful execution. The batch file or script can then test that value to select an appropriate next thing to do.
System.exit(n) just makes the JRE finish exceuting and return the value n as its return code. n can be any int value.
A word of caution though, even though the System.exit method accepts the entire gamut of integer values, there are certain restrictions imposed by the host systems (operating systems) on what kind of status codes are acceptable.