Jeanne Boyarsky wrote:doStuff(x, y); - y is a Boolean. Which isn't an Integer, so Integer... can't possibly be called
doStuff(x); - there is only one parameter here making Object a closer match.
doStuff(sa, sa); - short[] isn't an Integer either, so Integer... can't possibly be called
Note that if you comment out the first method, the output is 232. So it's not that doStuff(x) can't call Integer... It's that it chooses not to since Object is present.
I am not getting how can a primitive map to an Object, as Object is a superclass and Integer is a subclass, isn't
int closer to java.lang.Integer ??