HashSet.remove() and Iterator.remove() not working

前端 未结 10 1493
借酒劲吻你
借酒劲吻你 2020-12-13 00:32

I\'m having problems with Iterator.remove() called on a HashSet.

I\'ve a Set of time stamped objects. Before adding a new item to the Set, I loop through the set, i

10条回答
  •  离开以前
    2020-12-13 00:55

    If there are two entries with the same data, only one of them is replaced... have you accounted for that? And just in case, have you tried another collection data structure that doesn't use a hashcode, say a List?

提交回复
热议问题