Map in Java

Map in Java

A map in Java is a container object that stores elements in the form of key and value pairs. A key is a unique element (object) that serves as an “index” in the map. The element that is associated with…

Read MoreMap in Java

HashSet in Java

Java HashSet hierarchy diagram

HashSet in Java is an unordered collection of elements (objects) that contains only unique elements. That is, it allows duplicate free elements to be stored. It internally uses Hashtable data structure to store a set of unique elements. It is…

Read MoreHashSet in Java

Set in Java

Realtime example of set in Java

A set in Java is an unordered collection of unique elements or objects. In other words, a set is a collection of elements that are not stored in a particular order. Elements are simply added to the set without any…

Read MoreSet in Java

Vector in Java

Hierarchy of vector class in Java

Vector class in Java was introduced in JDK 1.0 version. It is present in Java.util package. It is a dynamically resizable array (growable array) which means it can grow or shrink as required. Java Vector class is similar to ArrayList…

Read MoreVector in Java