java stop function code example
Example 1: how to interrupt a void java
public void someMethod() {
//... a bunch of code ...
if (someCondition()) {
return; //This exits the method
}
//... otherwise do the following...
}
Example 2: break a function java
public void someMethod() {
//... a bunch of code ...
if (someCondition()) {
return; //break the funtion
}
//... otherwise do the following...
}