4

Looking through Java tests, cause I need to pass one for job. And every one of them has a question like:
What's the result of:
boolean b = 42 >= 1024;
if (b = true) System.out.print(1);
else System.out.print(2);

And each time I answer like there is (b == true) and not (b = true).
Cause no one in real life would write = in if statement. Why do they put such question in each and every test.

Comments
Add Comment