Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

System.exit(0)  RSS feed

 
Arthur Buliva
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the 0 in the method signify? I have noticed that even if I put any integer it still works!!
 
Martin Simons
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is the return code that is returned to the operating system.
Normally 0 means finished without error and any other integer means
that some error has occurred. This is useful in that your program,
if it needs to exit because of an error, can exit with a different
exit code for each error, and you can then document what each error
code actually means.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!