Jama, Welcome to Javaranch
As Ed Ward has mentioned it depends on the version of Java you are using. If you are using Java 5.0 or above it willl compile, run and give output as in Java 5.0 (or above) as Autoboxing/Unboxing feature is available in it. But if you are using previous versions of Java it supports only Colloections of Objects. As you are trying to store int values which are primitives, you need the corresponding wrapper class (Integer in this case) while inserting to treat it as Object type or you need explicit type casting in the time of retrieving . Hope you got it ..
One more request to you, do not use short texts and make the whole text bold rather the important points and while posting use corresponding threads (in this case Beginning Java or Java in General).