Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

System.exit(int status)

 
Steven Zeng
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, if the status argument of System.exit(int status) is a non-zero number,what does it mean?
As far as I know ,the non-zero argument here means abnormal exit,but is there specific meaning of different int arguments?
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set different ints to mean different things in your *.bat file that called the java app. Traditionally zero indicates a successful exit with no errors while one indicates something went wrong and the program exited abnormally.

Most of the time (unless you're writing GUI stuff) you won't need to deal with System.exit at all.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic