This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Could someone kindly tell me why the following piece of code behaves the way it does? Basically I've defined a hashmap where the key is a Long object. I populate the map with an entry and then try and retrieve that entry with an int primitive. I understand the int I pass into get() is autoboxed into an Integer. The compile-time check asserts that myint can be promoted from int to long, but what is happening at run-time that causes a value of 'null' to be returned? I prostrate before the Ranch and beseech its apt members for guidance!!
my value for int key is: null
my value for long key is: hello
"Wait till you look within yourself and see what is there.... Oh Seeker, one leaf in that garden is worth more than all of Paradise!"