List is an interface, and the list attribute is ordered, ensuring that elements are preserved in a certain order.
ArrayList is its implementation class, which is a list implemented with arrays.
Map is an interface, and the map attribute is to find objects based on an object.
HashMap is its implementation class, HashMap is implemented with a hash table map, is to use the object's Hashcode (Hashcode () is the method of object) for fast hash lookup. (for hash lookup, see << data structure >>)
In general, if not necessary, the recommended code only deals with the List,map interface.
For example: List list = new ArrayList ();
The reason for this is that the list is equivalent to a generic implementation, and if you want to change the type of the list, you only need to:
List List = new LinkedList ();//linkedlist is also the implementation class of the list, and also the brother class of ArrayList
In this way, there is no need to modify other code, which is the elegance of interface programming.
Another example of this is the following declaration in the method of the class:
private void Domyaction (List list) {}
This method can handle all the classes that implement the list interface, and implement generic functions to some extent.
You can customize your custom class by implementing List,map (or collection) if you feel that Arraylist,hashmap's performance does not meet your needs when developing.
The difference between list and ArrayList, map and HashMap