Computer Applications
Explain the use of System.exit(n) method in Java.
Java Conditional Stmts
6 Likes
Answer
The currently running program can be terminated with the help of the exit() method of the System class - System.exit(n). The argument n serves as a status code. A non-zero status code indicates abnormal termination, and a zero status code indicates a normal termination.
Answered By
4 Likes
Related Questions
Explain the significance of the default label in the switch statement.
Format the following if statements with indentation:if (x == y) {if (y == z) x = 1; y = 2; } else z = 1;
What is a fall through? Give an example.
Format the following if statements with indentation: if (x == y) if (x == z) x = 1; else y = 1; else z = 1;