[Quote=引用 2 楼 zhj92lxs 的回复:]
/**
* Compares this object to the specified object. The result is
* <code>true </code> if and only if the argument is not
* <code>null </code> and is an <code>Integer </code> object that
* contains the same <code>int </code> value as this object.
*
* @param obj the object to compare with.
* @return <code>true </code> if the objects are the same;
…
[/Quote]
对,是由于Integer类的equals方法决定的
/**
* Compares this object to the specified object. The result is
* <code>true</code> if and only if the argument is not
* <code>null</code> and is an <code>Integer</code> object that
* contains the same <code>int</code> value as this object.
*
* @param obj the object to compare with.
* @return <code>true</code> if the objects are the same;
* <code>false</code> otherwise.
*/
public boolean equals(Object obj) {
if (obj instanceof Integer) {
return value == ((Integer)obj).intValue();
}
return false;
}