4 ms·
The question doesn't use a.equals(1) it is a==1 which is not the same and does not use the equals() method in Java, so it can't be overridden. It compares primi
by dumbfounder 9y ago
The question doesn't use a.equals(1) it is a==1 which is not the same and does not use the equals() method in Java, so it can't be overridden. It compares primitives or variable references only.
However, it is possible for that statement to evaluate to true with threads if you manipulate the a at the right times.