memory cost of each type of Collection class

Hi, I wonder what is the memory cost of each type of Collection?

Suppose I want to keep a set of non-duplicate objects, HashSet removes duplicates automatically, but calculating hash is extra cost; instead i can use ArrayList and do a check "if contains, then adds" before adding an element. Which one is faster? And which costs less memory?

Thanks alot!

[374 byte] By [zqzuka] at [2007-11-26 16:19:56]
# 1
Use a Set, that's what it is there for.
YoGeea at 2007-7-8 22:43:28 > top of Java-index,Java Essentials,New To Java...