Best Practice wrt Boxing / Unboxing
Some people say that everything should be boxed.
So instead of using primatives like int, you should always use their wrappers.
But suppose I don't always want to copy references of my primatives into Hashtables and PriorityQueues etc.
I might need to store some integers in a big 3 dimensional array like this:
int arr = new int;
Surely using the Integer object for this would be madness, wouldn't it create a lot of overhead?
Unless that is if the compiller was able to automatically convert those Integer objects to ints, but does this really happen and if so how does it make that decision? Can I really be sure it will make the right choice?