How about
for (int k = 0; k < 10; k = k + 2) {
if (k == 2) {
break;
}
System.out.println(k);
}
The other way is a labelled loop
myloop: for (int i=0; i < 5; i++) {
for (int j=0; j < 5; j++) {
if (i * j > 6) {
System.out.println("Breaking");
break myloop;
}
System.out.println(i + " " + j);
}
}
For an even better explanation you can check here