A graph represents the approximate structure of a Java collection:
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/7F/1A/wKiom1cTjSzS1BbuAAE4uBxAcqM141.png "title=" 1111. PNG "alt=" Wkiom1ctjszs1bbuaae4ubxacqm141.png "/>
Collection interface-Defines the method of accessing the object, and its sub-interface set and list define the storage mode separately.
data Objects in set are not sequential and cannot be duplicated
The data objects in the list are in order and can be repeated
PS: The container must hold the object of the reference type, because the reference object is in the heap, will not be recycled by the GC at any time, sometimes we see the Add (2) Such code, is the JVM automatically help us to convert the int type to an integer type
The map interface defines a method for storing the key (key)-Value mapping pair
It is important to note that container class objects need to compare objects for equality when calling methods such as Remove,contains, which involves the Equals method and the Hashcode method of the object type, for custom types, You need to override the Equals and Hashcode methods to implement custom object equality rules, and equal objects should have equal hashcode, understanding "= =" and "Equals ()" Hashcode () methods
This article is from the "Henrysun" blog, make sure to keep this source http://henrysun1993.blog.51cto.com/6315762/1765186
Summary of Java Collections