Actually, not in java, anyway. in older times, maybe C, you may accidentally forget the exclamation mark, and the code will compile fine. basically a = nullaccepted as an expression that assigns a null value for aand is always evaluated as true (since the assignment was successful).
Compilers are much more reliable today. Although old habits die, and I'm still writing null != a: -)
source
share