default size of Hashtable,Hashmap,Hashset,Vector,Arraylist

The Collection framework contains all the classes and interfaces inside java.util package. 

Hashtable :- A Hashtable class implement Map is an unordered collection of key-value pairs, with a unique key for each is synchronized class. Hashtable doesn’t allow any null key or is not more faster compared to HashMap.

HashMap :- A Hashmap class implement Map interface. HashMap allows one null key and multiple null is not synchronized class. That’s why it is faster and take less memory.

HashSet :- A HashSet class implement Set does not allow duplicate value. HashSet is an unordered collection and does not maintain insertion order.

Vector :- A Vector class implement List is a synchronized class.Vector implements a dynamic array which means it can grow or shrink as required. 

ArrayList :- A ArrayList class implement List interface. ArrayList maintains the insertion order i.e order of the object in which they are inserted.its allow duplicate value. ArrayList class uses a dynamic array for storing the elements.

The default size of Hashtable,Hashmap,Hashset,Vector and Arraylist are:

  • Hashtable = 11
  • Hashmap = 16
  • Hashset = 16
  • Vector = 10
  • Arraylist = 10