How to break out or exit a method in Java?
Use the return keyword to exit from a method. From the Java Tutorial that I linked to above: Any method declared void doesn’t return a value. It does not need to contain a return statement, but it may do so. In such a case, a return statement can be used to branch out of a control flow … Read more