Default size of treeset/CopyOnWriteArrayList in java?

445 views Asked by At
  • What is the default size of TreeSet and CopyOnWriteArrayList?
  • What is the load factor of TreeSet and CopyOnWriteArrayList?
  • What is the size growth rate of TreeSet and CopyOnWriteArrayList?

Thanks in advance.

1

There are 1 answers

0
Andreas On

The 3 properties you're asking about don't really apply to TreeSet and CopyOnWriteArrayList, same as they don't apply to e.g. LinkedList.

But if you want answers, they are:
Default size: 0
Load factor: 100%
Size growth rate: 1

I.e. the default/initial size is 0, they are always 100% full, and they grow/shrink by 1 every time an element is added/removed.