473,395 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

System.exit(0)

184 100+
Hi,
"System.exit(0)"-->It means that it terminates the currently running Java Virtual Machine with "0" as status. what does that "status" refers to?
Even its working for System.exit(2) or for any status value.. could anyone clear that? Thanks in advance

-Thanks & Regards,
Hamsa
Mar 19 '08 #1
5 2866
r035198x
13,262 8TB
Hi,
"System.exit(0)"-->It means that it terminates the currently running Java Virtual Machine with "0" as status. what does that "status" refers to?
Even its working for System.exit(2) or for any status value.. could anyone clear that? Thanks in advance

-Thanks & Regards,
Hamsa
The API Specs are your friend.
Mar 19 '08 #2
gaya3
184 100+
The API Specs are your friend.

Thank u.. yes.. Its mentioned as "status".I would like to know "status of what"

-Thanks & Regards,
Hamsa
Mar 19 '08 #3
r035198x
13,262 8TB
Thank u.. yes.. Its mentioned as "status".I would like to know "status of what"

-Thanks & Regards,
Hamsa
The entry also tells you to see the entry for Runtime.exit which is called by System.exit ...
Mar 19 '08 #4
JosAH
11,448 Expert 8TB
Hi,
"System.exit(0)"-->It means that it terminates the currently running Java Virtual Machine with "0" as status. what does that "status" refers to?
Even its working for System.exit(2) or for any status value.. could anyone clear that? Thanks in advance

-Thanks & Regards,
Hamsa
It is the return value from the entire process. You can test it using "errorlevel"
on a Windows box or using "status" on a Unix box. Traditionally 0 means a
successful exit and any other value should indicate a failure of some sort.
Standard C only allows for the values 0 and 1 for a success or failure across
different platforms. Most Windows people seem to ignore this capability by
not returning anything at all from their "main()" method and even making it
a void function (in C or C++). If the main() function in Java doesn't explicity
uses the exit() method 0 is assumed, i.e. a successful termination of the process.

kind regards,

Jos
Mar 19 '08 #5
gaya3
184 100+
It is the return value from the entire process. You can test it using "errorlevel"
on a Windows box or using "status" on a Unix box. Traditionally 0 means a
successful exit and any other value should indicate a failure of some sort.
Standard C only allows for the values 0 and 1 for a success or failure across
different platforms. Most Windows people seem to ignore this capability by
not returning anything at all from their "main()" method and even making it
a void function (in C or C++). If the main() function in Java doesn't explicity
uses the exit() method 0 is assumed, i.e. a successful termination of the process.

kind regards,

Jos

Thanks Jos!

-Thanks & Regards,
Hamsa
Mar 19 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Randy Jackson | last post by:
I'm attempting to debug some code that uses the System function. When the function is called, it returns Error 1. Does anyone know what that error might be, or where I can find a list of error...
0
by: Sanket | last post by:
I have a java application, which generates a html file. Here is how main method looks like public static void main(String args) { //Create a new file using File class. //Make backend calls and...
1
by: Erik Johnson | last post by:
Hi, I am trying to spawn a daemon type program to go off on its own and do some work (asynchoronously) from within an HTTPServer, but I am running into a problem where the web browser (actually...
2
by: Xah Lee | last post by:
Python Doc Problem Example: os.system Xah Lee, 2005-09 today i'm trying to use Python to call shell commands. e.g. in Perl something like output=qx(ls) in Python i quickly located the...
2
by: fran | last post by:
Server: IBM XSERIES 225 (Intel Xeon CPU 2.40GHz 1GB RAM) Operating System: Linux RedHat ES 2.1 kernel 2.4.9 Languaje: C++ Compiler: gcc 2.96 Libs: pthread We are in need of your help in...
10
by: One Handed Man [ OHM ] | last post by:
If this is duplicated, I'm sorry because I cant find the original post I made today Anyway . . Now its my turn to ask a question I want to develop an app which will run in the system tray....
6
by: Don | last post by:
I'm having problems working with a streamwriter object. After closing the streamwriter and setting it to Nothing, I try to delete the file it was writing to, but I always get the following error...
2
by: Ron St-Pierre | last post by:
We're developing a java app and are using postgres as the database. On our dev server I started the app, closed it, but the java process was still open so I killed it, which caused the above error....
13
by: Gary Wessle | last post by:
hi how can I use $wc -l file_name which puts out the number of lines. #include <cstdlib> using std::system; system (wc -l file_name) I get...
5
by: =?Utf-8?B?Z215ZXJz?= | last post by:
Hello, I am attempting to start a cmd.exe process and pass several .vbs scripts (with additional parameters) and then read the output from the scripts and make "notes" in a DataTable (the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.