java how to stop code

Java
System.exit(0);
Source

Also in Java: