That was my bailout strategy. I wanted to do it shorter. I still don't get why it doesn't work. result is a legal address of the first Hashmap, right? Sow why can't I "put" anything there? Thanks anyway!
Again, we need to see more code. There must have been some other lines between HashMap result = new HashMap; and result.put("name", new String("The Name")); or you would have gotten a NullPointerException. You need to show us the actual code you're using here, in order to get an explanation. Or if this really is the code you're looking at, then delete your .class file and recompile. If that doesn't work, study your class path carefully and look for a .class or .jar file in another directory which is getting run instead of the class you're trying to execute. One way or another, you're not running the code you show above. [ February 16, 2003: Message edited by: Jim Yingst ]
result is a legal address of the first Hashmap, right?
result is not a legal address until you initialize it. You've declared it, but you have not initialized it. Therefore, you should be getting a NullPointerException, as Jim and Thomas have already pointed out.
I see nothing here that would cause an ArrayIndexOutOfBoundsException.
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt