1. List: (Sub-class feature of the list of questions)
(1) ArrayList:
The underlying data structure is an array , query fast, and delete slowly.
Threads are unsafe and highly efficient.
(2) Vector:
The underlying data structure is an array , query fast, and delete slowly.
Thread-safe, low-efficiency.
(3) LinkedList:
The underlying data structure is linked list , query slow, delete quickly.
Threads are unsafe and highly efficient.
2. List has three sons, who do we use?
Look at the demand (condition).
(1) to be safe?
To: Vector (even if you want to be safe, do not use this, there is a substitute later)
Do not: ArrayList or LinkedList
Query MORE: ArrayList
More additions and deletions: LinkedList
(2) If you don't understand anything, use ArrayList.
Java Basic Knowledge Enhancement Collection Framework note 22:list features of three subclasses of the collection (interview questions)