Since the work, has been the Java Collection understanding is not comprehensive enough, not deep enough, is commonly used arraylist/hashmap/set/list, sometimes will use a linkedlist. On a whim, there may be some interest in treeset,hashset. However, the collection of these companies interview often asked, especially the tall company also asked very deep. So I search for some information, according to their own understanding of the reorganization.
Java Collection frame diagram: http://www.cnblogs.com/lmy-foolishbird/p/5405641.html
Key points:
1. Top-level interface: Java.util.collection,java.util.iterator. (Java.lang.Iterable is not in java.util.) Classes that implement the Iterable interface can traverse the collection collection through iterator, but traverse the map)
2.Collection Next face interface determines whether internal elements are ordered or unordered:
List interfaces, lists, commonly used implementations have the array implementation of the ArrayList, linked list implementation of the LinkedList. All allow the addition of duplicate elements. Disordered
The set interface, set, does not allow repeating elements. Common implementation classes have HashSet (through the map of the HashMap implementation, unordered), TreeSet (through the TREEMAP implementation of the map, ordered also implemented SortedSet interface, so is ordered)
Deque interface, queue, bidirectional
The vector class is an array of vectors that can be used to grow an array of objects, usually implemented as stack stacks, advanced and out;
3. A design pattern is used in the Set frame: Adapter mode. Adapter Mode key points: If a ray, want to implement a partial method of an interface, not all, this time add an intermediate abstract class, this abstract class implements all the methods in the interface, and then our own front-line implementation class inherits this abstract class, implementation of the abstract class part of the method can be.
For example: Map interface, through Abstractmap abstraction, in to specific Treemap,hashmap implementation class.
The 4.Arrays and Collections tool classes are the two tool classes used to manipulate arrays and collections.
5. The source code behind the jdk1.8 is checked.
Java Collection series