Originally posted by Steve McCann: Hi Sherry You can't cast from a primitive to an Object. Try creating a new Integer rather than casting, e.g. for (int i=0;i<names.length;i++) { myMap.put((String)names[i], new Integer(marks[i])); } Steve [ August 04, 2005: Message edited by: Steve McCann ]