Collection Interview Questions

Difference Between Iterator And Enumeration

Difference Between Iterator And Enumeration The most common interview question in Collections is What is the difference between iterator and enumeration. Iterator Iterator is the interface and found in the java.util package. It has three methods *hasNext() *next() *remove() Enumeration Enumeration is also an interface and found in the java.util package. An enumeration is an Read More →

Difference Between HashMap And HashTable

Difference Between HashMap And HashTable 1. Synchronization or Thread Safe : This is the most important difference between two. HashMap is non synchronized and not thread safe. On the other hand, HashTable is thread safe and synchronized. 2. Null keys and null values : Hashmap allows one null key and any number of null values, Read More →

ArrayList vs. LinkedList

arraylist-vs-linkedlist-complexity

ArrayList vs. LinkedList   ArrayList is implemented as a resizable array. As more elements are added to ArrayList, its size is increased dynamically. It’s elements can be accessed directly by using the get and set methods, since ArrayList is essentially an array. LinkedList is implemented as a double linked list. Its performance on add and Read More →