Set Set
Common methods:
1, int size (): Returns the number of elements in the set
2. Boolean isEmpty (): Returns True if no element is included
3, contains (Object O): Returns True if the specified element is included
4. Boolean Add (Object O): If the specified element does not exist, then add to the set
5. Void Clear (): Remove all elements from set
6. Boolean RemoveAll (Collection C): If the set contains the specified collection, remove all elements from the set that make the collection
Implementation class:
HashSet: There is no relationship between the order in which elements are stored and the order in which they are added
Linkedhashset: Preserving the order in which elements are added
TreeSet: Sort the elements in a set
###########################################################################################
List Collection
Common methods:
1. public void Add (E Element)
2. public void Add (int index,eelement)
3. public void AddAll (E element)
4. public void AddAll (Intindex,collection c)
Implementation class:
ArrayList: Asynchronous processing with high performance and non-thread-safe
Vector: Synchronous processing, low performance, thread safety
This article is from the "Zero Technology Road" blog, please be sure to keep this source http://zerohou.blog.51cto.com/3019528/1615018
Set of explanations