This is classical, but writing to Google did not give me hits.
My code:
Integer i = ..; // Sth is put from database.
if (i != 1) {
// do sth
} else {
// do not.
}
Case:
I know that this comparison is not correct java
and I should compare:
if (i.intValue != 1) {}
or
if(!i.equals(1)) {}
but my code had the first one and I seem to get the true from somewhere, where the Integer
is not 1 and when it is 1 there comes false.
Question:
What is happening there around?