Check out example codes for "how to stop a void java". It will help you in understanding the concepts better.

Code Example 1

public void someMethod() {
    //... a bunch of code ...
    if (someCondition()) {
        return; //This exits the method
    }
    //... otherwise do the following...
}

Learn ReactJs, React Native from akashmittal.com