If I try to do a .equals() on a null string in java, a null pointer exception will be thrown. I am wondering, if I am trying to compare if a string is equal to
.equals()
is this just really poor code?
No, this is the way many people would code the statement to avoid NPE.