wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes exit statement in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "exit statement in java" Watch "exit statement in java" New topic
Author

exit statement in java

Mike Shn
Ranch Hand

Joined: May 26, 2001
Posts: 149
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

Joined: Jan 09, 2001
Posts: 1492
Hi Mike,
Try:
System.exit( int )
Regards,
Manfred.
Mike Shn
Ranch Hand

Joined: May 26, 2001
Posts: 149
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

Joined: Jul 22, 2000
Posts: 9044
    
  10
Same as in C++ -- System.exit(0) is an exit without error and System.exit(1) is an exit due to an error.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
Consider Paul's rocket mass heater.
 
subject: exit statement in java
 
Similar Threads
Endless Loop
header files in Java?
JVM will not exit?
exit java statement
Break Statement