I don’t know why this condition is never satisfied:
I’m comparing two ArrayList values, and it is always false.
if ( (Integer) results.get(rank) == (Integer) experts.get(j))
I’m debugging and I have exactly the same 2 values: 3043 and 3043
However it doesn’t work.
thanks
Use
equals(), not==. These are two different objects which represent the same value. So they are not==(different objects) but areequals()(same content).