ArrayList:底層的數據結構使用的是數組結構。特點:查詢速度很快,但是增刪稍慢。線程不同步。默認長度10,超過再new一個數組延長50%,元素重新拷貝。
ArrayList底層實現:
static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length)
Copies an array from the specified source array, beginning at the specified position, to the specified position of the destination array.
LinkedList:底層的數據結構使用的是鏈表結構。特點:增刪速度很快,查詢速度稍慢。
Vector:底層是數組數據結構。線程同步。被ArrayList代替。默認長度10,超過100%延長。
