3 ms·
They (also) exist for basic Java strings. aString.equals("SOMETHING") will throw an exception if aString is null, while "SOMETHING".equals(aString) will just r
by Wilya 14y ago
They (also) exist for basic Java strings.
aString.equals("SOMETHING") will throw an exception if aString is null, while "SOMETHING".equals(aString) will just return false.
In some cases, that's one 'if' less to write.