The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
March 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Use return instead

Posted by Kishori Sharan on March 02, 2001 at 5:22 PM

System.exit ( 0 ) ; is used to stop JVM in Java. So you are getting correct behaviour. You need to use return statement as

if ( condition_to_exit) {
return ;
}
else {
}

if your method returns void then you can just use return; else you will have to return an appopriate value;



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us