8 ms·
It's not necessary in Java (though it's still a common habit). Assignment to a non-boolean is impossible in an if statement in Java, and you can make the compil
by hyperpape 13y ago
It's not necessary in Java (though it's still a common habit). Assignment to a non-boolean is impossible in an if statement in Java, and you can make the compiler warn you about accidental assignments.
- rbanffy 13y agoStill, assigning a boolean rather than comparing it is still possible and, possibly, a source of bugs.