How come the below code prints "The value of J is: 1000"?
I would've thought that the "j != 1000" would evaluate to false in all instances (Because 1000 mod 19 is not 0), hence making it an infinite loop.
public static void loop2() {
int j = 0;
for(int i=0;j != 1000;i++) {
j = j+19;
}
System.out.println("The value of J is: " + j);
}