I was working on some java classes, and was overriding the .equals(Object)
method to test an integer variable of my class, and was surprised when it threw errors saying I could not use the primitive type int, when I was sure it said in the java docs that the compiler will automatically autobox primitive types into the wrapper types for methods.
public boolean equals(Object o)
{
if (!(o instanceof myClass))
return false;
myClass mc = (myClass)o;
return (this.myInt.equals(mc.getMyInt()));
}