how to exit a java program

Java
System.exit(0);
Source

Also in Java: