equalsIgnoreCase(null); will definitely result in a NullPointerException . So equals methods are not designed to test whether an object is null, just because you can’t invoke them on null .
equalsIgnoreCase(null); will definitely result in a NullPointerException . So equals methods are not designed to test whether an object is null, just because you can’t invoke them on null .