What is System.exit(0),System.exit(1) and System.exit(-1)?

  • System.exit(0) – It indicates that execution runs successfully.

  • System.exit(1)- It indicates something which is expected went wrong.
                                   Example : Bad command Line, File not found, could not connect to server.
  • System.exit(-1)- It indicates something which is Un-expected went wrong.

                                   Example : System error, Unanticipated exception, Externally forced termination.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s