What is System.exit(int status) method

What is System.exit(int status) method

Postby SHilpy » Mon Feb 04, 2013 5:13 pm

What is System.exit(int status) method and why do we need it.
SHilpy
 
Posts: 6
Joined: Thu Jan 31, 2013 2:34 am

Re: What is System.exit(int status) method

Postby Kishan » Thu Feb 07, 2013 5:59 am

Always program execute from top to bottom then finally exit program status code 0 means no error.

During the execution of program if you want terminate program with some error code you use statement System.exit(-1). Status can be any value.
Kishan
 
Posts: 191
Joined: Tue Jan 29, 2013 4:21 am


Return to Core Java

Who is online

Users browsing this forum: No registered users and 1 guest

cron