how to exit a method in java code example
Example 1: how to exit a java program
System.exit(0);
Example 2: break a function java
public void someMethod() {
//... a bunch of code ...
if (someCondition()) {
return; //break the funtion
}
//... otherwise do the following...
}