Java knowledge necessary for testing (3) — collection and map related

Set correlation

Differences among list, set and map

Differences among vector, ArrayList and LinkedList

Vector: dynamic array, safe, capacity expansion doubled

ArrayList: dynamic array, unsafe, capacity expansion increased by 50%, initial capacity increased by 10%

LinkedList: a two-way linked list. It's not safe. It doesn't need to be adjusted. It's easy

Why is TreeSet ordered

Implement sortedset interface, or maintain a sort order through comparator or comparable

HashMap aspect

Internal data structure of HashMap

The bottom layer uses a hash table (linked list (O (n)) + array). If the length of the linked list is too long, it will be converted to a red black tree implementation (O (logn))

HashMap tips

Differences among hashtable, HashMap, treemap and LinkedHashMap

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>