You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---> Enumeration:- Like a museum tour, it guides you through elements one by one, letting you observe but not interact. Think of legacy collections like Vector and Stack.
---> Iteration:- Like a playground, it lets you freely explore and even modify elements. Works with modern collections like ArrayList and HashMap.
While Enumeration is read-only, while Iteration lets us to add, remove, or change the elements.
Iteration is more flexible and works with most collections.
Enumeration don't have remove() method
Iterator have hasNext(), next(), remove() method.
Enumeration have hasMoreElement(), nextElement() method only
The text was updated successfully, but these errors were encountered: