Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exit statement in java

 
Mike Shn
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I know that C++ uses the exit(0) and exit(-1) statement. Does Java uses something similar?
Thanks a lot
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mike,
Try:
System.exit( int )
Regards,
Manfred.
 
Mike Shn
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Manfred Leonhardt:
Hi Mike,
Try:
System.exit( int )
Regards,
Manfred.


Thanks
but what is difference between System.exit(0) and System.exit(1)
??? Thanks a lot
 
Marilyn de Queiroz
Sheriff
Posts: 9064
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Same as in C++ -- System.exit(0) is an exit without error and System.exit(1) is an exit due to an error.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic