Collection
Collection:collection the root interface in the hierarchical structure;
Overview of Collection features:
* 1: Add features
* Boolean Add (Object obj): Add an Element
* Boolean AddAll (Collection C): Add an element of a collection
* 2: Delete function
* Void Clear (): Remove all elements
* Boolean remove (Object o): Removes an element
* 3: Judging function
* Boolean contains (Object O): Determines whether the specified element is contained in the collection
* Boolean isEmpty (): Determines whether the collection is empty
* 4: Get features
* iterator<e> Iterator () returns a Iterator object that iterates through the elements in the collection.
* 5: Length function
* int size (): Number of elements
{
Study questions: Does the array have the length () method? Does the string have the length () method? Does the collection have the length () method?
Ans: Array get length is: array.length
String: Length ()
Collection: Size ()
}
* 6: Convert the set to an array
* object[] ToArray ()
Java Basics (v)---collection collection