Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
tasubotadas
· 7y ago · 0 comments
Ahh... The good 'ol technique for avoiding NPEs in Java.
Comments
[–]
neatcoder
7y ago
For those who are wondering what this refers to, it is writing code like this:
"foo".equals(myVar)
instead of writing:
myVar.equals("foo")
which could can cause NullPointerException if myVar is null.
[–]
delinka
7y ago
you've missed a closing " which makes this read differently than intended
[–]
neatcoder
7y ago
Thanks. Fixed now.