You are viewing an older version of the site. Click here to view
the latest version of this page. (This may be a dead link, if so, try the root page of the docs
here.)
== exit ==
Copy Code
The output might be:
Copy Code
The output might be:
Exits the program. If this is being run from the command line, works by exiting the interpreter, with the specified exit code (defaulting to 0). If this is being run from in-game, works just like die().
=== Vital Info ===
{| style="width: 40%;" cellspacing="1" cellpadding="1" border="1" class="wikitable"
|-
! scope="col" width="20%" |
! scope="col" width="80%" |
|-
! scope="row" | Name
| exit
|-
! scope="row" | Returns
| void
|-
! scope="row" | Usages
| [int]
|-
! scope="row" | Throws
|
|-
! scope="row" | Since
| 3.3.1
|-
! scope="row" | Restricted
| No
|-
! scope="row" | Optimizations
| [[../../Optimizer#TERMINAL|TERMINAL]]
|}
=== Usages ===
exit([int])=== Examples === ====Example 1==== Basic usage Given the following code:
#Causes the JVM to exit with an exit code of 0
exit(0)

1 #Causes the JVM to exit with an exit code of 0
2
3 {{function|exit}}(0)
NOWIKI====Example 2==== Basic usage Given the following code:
#Causes the JVM to exit with an exit code of 1
exit(1)

1 #Causes the JVM to exit with an exit code of 1
2
3 {{function|exit}}(1)
NOWIKI
Find a bug in this page? Edit this page yourself, then submit a pull request. (Note this page is automatically generated from the documentation in the source code.)