Is it bad practice to use break to exit a loop in Java? [closed]
I was wondering if it is a "bad practice" to use a break statement to exit a loop instead of fulfilling the loop condition? I do not have enough insight in Java and the JVM to know how a loop is handled, so I was wondering if I was overlooking something critical by doing so. The focus of this question: is there a specific performance overhead? Good lord no. Sometimes there is a possibility that something can occur in the loop that satisfies the overall requirement, without satisfying the logical loop condition. In that case, break is used, to stop you cycling around a loop pointlessly. Example