aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes System.exit(0) &System.exit(1) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "System.exit(0) &System.exit(1)" Watch "System.exit(0) &System.exit(1)" New topic
Author

System.exit(0) &System.exit(1)

harish shankarnarayan
Ranch Hand

Joined: Sep 12, 2005
Posts: 158
can anyone give me some idea about using ,wat exactly happens
System.exit()
in try-catch-finally block
all the cases.


Harish<br />SCJP 1.4 (85%)
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Well if the JVM goes down before finally gets to run, then the finally block won't run. Otherwise finally will be run.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Gagan Deep
Ranch Hand

Joined: Aug 23, 2005
Posts: 47
Mark,

Will number in System.exit(number) matter?

What is the difference between System.exit(0) & System.exit(1)?

Thanks
Gagan.
Jay Pawar
Ranch Hand

Joined: Aug 27, 2004
Posts: 411
Originally posted by Gagan Deep:
Mark,

Will number in System.exit(number) matter?

What is the difference between System.exit(0) & System.exit(1)?

Thanks
Gagan.


The argument serves as a status code; by convention, a nonzero status code indicates abnormal termination.

HTH


Cheers,<br />Jay<br /> <br />(SCJP 1.4)<br />Heights of great men were not achieved in one day, they were toiling day and night while their companions slept.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: System.exit(0) &System.exit(1)