In addition to the above you can use the System.exit()
to return an exit code which may be very usuefull specially if your calling the process automatically using the System.exit(code);
this can help you determine for example if an error has occured during the run.