The Java collections framework consists of the classes and interfaces that implement a collection data structure. Collections are similar to arrays in that respect as they can hold references to objects and can be managed as a group. The difference is that arrays require their capacity being defined before they can be used, while collections can increase and decrease their size automatically as needed. You just add or remove an object reference to a collection, and the collection changes its size accordingly. Another difference is that the collections cannot have their elements to be primitive types, such as short, int, or double. If you need to store such type values, the elements must be of a corresponding wrapper type, such as Short, Integer, or Double, for example.
Java collections support various algorithms of storing and accessing the elements...