A collection is also called a container, similar to an array, and is the whole of the same type of elements.
The collection has the following excuse Collection interface
Iterator Interface
List interface and implementation class
Set interface and implementation class
Map interfaces and implementation classes
The 2.Collection interface provides common operations for the collection interface:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/51/wKioL1X6UM2Cf3V3AAJcXBI2OaY449.jpg "style=" float: none; "title=" pilcz.jpg "alt=" Wkiol1x6um2cf3v3aajcxbi2oay449.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/51/wKioL1X6URDwCMrVAAK_SUstzog788.jpg "style=" float: none; "title=" jibcz.jpg "alt=" Wkiol1x6urdwcmrvaak_sustzog788.jpg "/>
3.List interface and set interface
A List interface whose implementation class creates an ordered set of elements with subscript and repeating elements.
The main realization class has ArrayList , linkedlist ,Vector .
A set interface whose implementation class creates an unordered collection that does not allow duplicate elements.
The main implementation classes are HashSet , linkedhashset , TreeSet .
4. Iterating through the collection
For-each structure Traversal
for (Object o:c) {
System.out.print (O.tostring ());
}
Iterator iterator traversal
public interface iterator<e>{
public boolean hasnext ();
Public E next ();
public void Remove ();
}
The 11th chapter: set (i)