Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-09-2008, 11:25 AM
Member
 
Join Date: Jun 2008
Location: Mumbai
Posts: 2
ramakanta.majhi is on a distinguished road
system.exit(..)
Plz tell me what is the difference between exit(0),exit(1),exit(2)?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-09-2008, 06:06 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 527
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
the integer values are just a flag... (depends on you)...

In convention, 0 means the java simple/complex application exits without any again any suspicious/malicious process being done before the java application exits...

a positive value will be thrown after terminating the process when an exception occured before the termination of that process....

an example is like:
trying to access dead Component's instance after calling dispose method, after calling garbage collector and System.runFinalization() and before invoking System.exit(int flag)..

Usually, for me, negative values are being treated as flag for an experiment......

eg. having some experiments on an "under testing" application where the program's behavior should be traced when it terminates, what location of the code it terminates exactly, and for prediction/debugging purposes....

PS. you've posted this thread in an inappropriate forum section...
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by sukatoa : 06-09-2008 at 06:11 PM.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 06-14-2008, 03:28 AM
Member
 
Join Date: Jun 2008
Posts: 22
ferranb is on a distinguished road
Each process runing on a system if its terminates nicely it returns a value to the parent process.

By convention the 0 means normal termination, any other value depends on the developer mind.

To terminate a java proces, you have the exit() function the argument is the return value of the proces.

Ferran
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Could not find the main class, program will exit. aryubi New To Java 22 12-03-2008 12:28 AM
JVM terminated Exit code=1 oregon Eclipse 3 09-29-2008 11:49 PM
help with System.exit (1) function call katie Advanced Java 2 08-06-2007 10:03 PM
How to exit the program.. coco New To Java 1 08-01-2007 07:56 PM


All times are GMT +3. The time now is 01:11 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org