Record 10 --- learning about some of the topics collections

1. What is List and Set interface is a parent?
A: List and Set interfaces is the parent Collection


2, List interface implementation class and which of (written 4)
A: There are ArrayList, LinkedList, Stack, Vector


3, the difference between ArrayList and LinkedList?
A: ArrayList linear storage, query and modify the block, add and delete slow; LinkedList using chain store, add and delete blocks, query and modify slow.


4, Vector and ArrayList difference?
A: The security thread of Vector, ArrayList thread safe.


5. What HashSet and TreeSet interface is a parent?
A: HashSet and TreeSet interface is the parent Set


6, compare the difference between internal and external comparators, respectively, when to use?
A: The internal comparator is that it gives a class supports sorting, and external comparator is to make a sort of class does not support the sort, when we need to build a collection of tree storage, we need to create internal comparisons to the class of this object It is, when we use a set of soft method for sorting when you need to define an external comparator to sort.


7. What HashMap and TreeMap interface is a parent?
A: HashMap and TreeMap parent interface is a Map


8. What is the difference between HashMap and TreeMap?
A: HashMap starting with the use of a chain store, but after more than 8 on the use of red-black tree stored, and TreeMap from the outset on the use of red-black tree stored.

Guess you like

Origin www.cnblogs.com/huajidafahao/p/11295157.html