r/learnjava • u/Defiant_Vanilla_4080 • Mar 04 '26
why is the i value not 2 after we hit the first time system.out?
public static void main(String[] args) {
for (int i = 1; i <= 4; i++) {
for (int k = 1; k <= 4; k++) {
if (i > k) {
continue;
}
if (i < k) {
break;
}
System.out.println(i * k);
}
}
}
}I justed the debugger and it showed that I is still 1 but after hitting the second time syso, it increases to 2
Imgur link