Given is the following code:
public class tester {
public static void main(String args[]) {
int a = 0;
while(a == a++) {
a++;
System.out.println(a);
}
}
}
My question is, why would this print out all even numbers, starting from 2?
Why does it even go through the while loop? The condition in the very beginning: if a is equal to a+1: but 0 is not equal to 1.
That's at least my thoughts on this. Any proper answer?