Java – Does returning a value break a loop?
Yes* Yes, usually (and in your case) it does break out of the loop and returns from the method. An Exception One exception is that if there is a finally block inside the loop and surrounding the return statement then the code in the finally block will be executed before the method returns. The finally … Read more