-
M
Java equals() selection
In Java, if I try to do.equals() on a null string, a null pointer error is issued. I’m wondering whether I can perform the following if I’m attempting to compare if a string is equal to a constant string: MY CONSTANT STRING.equals(aStringVariable) I’m sure it’ll work, but is this simply...- mishrajicoder
- Thread
- best practices comparison equals error handling idioms java null pointer dereference programming string yodacondition
- Replies: 1
- Forum: General Computing