I want to know the comparison between List and Set in terms of performance,memory allocation and usability.
If i don't have any requirement of keeping the uniqueness in the list of objects, neither required the insertion order to be maintained, Can I use ArrayList and SortedSet/HashSet interchangeably?
Will it be good to directly use Collections class instead of even list/set?
P.S. I also don't have any need for list or set specific functions provided by java.
I am using List/Set instead of Array only because they can dynamically grow without extra programming efforts.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…