This shows you the differences between two versions of the page.
| — |
java:lang:system:exit [2024/02/16 01:12] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== exit ====== | ||
| + | <code java> | ||
| + | public static void exit(int status) | ||
| + | </code> | ||
| + | exit a programm with a return code | ||
| + | ===== example exit in java ===== | ||
| + | <code java> | ||
| + | package test; | ||
| + | |||
| + | public class Test{ | ||
| + | |||
| + | public static void main(String[] args) { | ||
| + | |||
| + | |||
| + | System.out.println("Example for exit in java"); | ||
| + | System.exit(1); | ||
| + | System.out.println("sorry but this is after our exit"); | ||
| + | |||
| + | |||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | </code> | ||
| + | |||
| + | ==== output of exit==== | ||
| + | Example for exit in java | ||
| + | Java Result: 1 | ||
| + | |||