HashMap or Hashtable problem?

Hello all,I'm using HashMap to save key and object.The problem that I have is two of the key and value pairs are saved into same bucket. I tried same code with Hashtable, but same thing is happened.Why this thing is happened?
[268 byte] By [Julie_Kim] at [2007-9-30 6:21:58]
# 1

Hashing functions don't guarantee that buckets will contain ONLY ONE item. Collisions (duplicate hashcodes) can, and will occur, and will result in two or more entries being stored in a bucket.. This is by design.

I can't tell fron your post what you need. Maybe these references will help: http://www.google.com/search?q=how+hashtables+work

ChuckBing at 2007-7-1 20:40:49 > top of Java-index,Administration Tools,Sun Connection...
# 2
It's probably because the two keys are "equal" (i.e. key1.equals(key2) returns true)
ProfessorSlarks at 2007-7-1 20:40:49 > top of Java-index,Administration Tools,Sun Connection...
# 3
I think it would be because they have the same hashcode, but are not equal.
nasch_ at 2007-7-1 20:40:49 > top of Java-index,Administration Tools,Sun Connection...
# 4
OTOH, maybe the OP misused the term "bucket," in which case ProfStarks may be right.
nasch_ at 2007-7-1 20:40:49 > top of Java-index,Administration Tools,Sun Connection...
# 5
Is there actually an easy way to tell in which bucket did the Map put your item?
teka at 2007-7-1 20:40:49 > top of Java-index,Administration Tools,Sun Connection...