Exiting a Java Program // Normal termination. System.exit(0); // Abnormal termination. int errorCode = -1; System.exit(errorCode);