English

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?
Chapter 7: Statements and their Scope - EXERCISE [Page 163]

APPEARS IN

Dheeraj Mehrotra Computer Science [English] Class 12
Chapter 7 Statements and their Scope
EXERCISE | Q 8. (a) | Page 163
Advertisements
Share
Notifications



      Forgot password?
Use app×