Enumeration Iterator

Collections Comparisons

You must be very strong in Java DS to write comparisons between various Collection classes. This tutorial gives you possible Java DS comparisons. Enumeration vs Iterator Iterator vs ListIterator Vector vs ArrayList Array vs ArrayList for vs foreach Hashtable vs HashMap Set vs HashSet Map vs HashMap HashMap vs TreeMap Comparable vs Comparator HashSet vs …

Collections Comparisons Read More »

Enumeration vs Iterator

After practicing Enumeration and Iterator with examples, let us summarize the differences. Both Enumeration and Iterator are used for iterating elements of a data structure. Iterator, being latest, comes with more features tabulated below. Enumeration Iterator Introduced with JDK 1.0 Introduced with JDK 1.2 Cannot remove any elements Can remove elements from the original DS …

Enumeration vs Iterator Read More »