Is it bad practice to use break to exit a loop in Java? [closed]
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 String item; for(int x = 0; x < 10; x++) { // Linear search. … Read more