Your break breaks the for loop. And the break you use later break the switch . You can consider this code example:
for(int i=0;i<len;i++) { for(int j=0;j<len;j++) { //statements break; } //statements break; }
break inside the inner loop breaks the inner loop, and the next break statement break the outer loop. In your sample code, the break you noticed is inside a for loop. Thus, the for loop will break.
source share