19 November, 2014

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.

 

No comments:

Post a Comment