LinkedHashSet or ArrayList

Viewed 14170

I wish to

  1. Avoid duplicated item being inserted.
  2. When I iterate through the collection class, the returned item is same as insertion order.

May I know, what thing I should consider, to choose either ArrayList (explicitly perform contains check before insertion) or LinkedHashSet?

Thanks.

4 Answers
Related