I have a really strange problem with java under Debian. On windows this works:
boolean X=true;
while(X);
This code performs a loop while X
is true, when i set X
to false the while loop ends.
The problem is that on Debian the SAME code, when i set X
to false, the while loop does not stop.
If I modify the the code:
boolean X=true;
while(X) {
System.out.println("hello");
}
This code works fine on Debian but only if I add the print statement. If I try i++
for example it doesn't work correctly, only with the print statement it works.
Why is my code handled differently on a different OS?