Explain the following jumping statement: Exit ()
Advertisements
Question
Explain the following jumping statement:
Exit ()
Explain
Advertisements
Solution
In Java, the System.exit() method is used to terminate the execution of a program immediately. It stops the Java Virtual Machine (JVM) and ends the program, regardless of where it is called.
The statement System.exit(0); indicates normal termination of the program, while a non-zero status value generally indicates abnormal termination.
shaalaa.com
Is there an error in this question or solution?
