Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between enumeration and iteration #97

Open
manishkaushik900 opened this issue Jun 3, 2021 · 2 comments
Open

Difference between enumeration and iteration #97

manishkaushik900 opened this issue Jun 3, 2021 · 2 comments

Comments

@manishkaushik900
Copy link

Enumeration don't have remove() method

Iterator have hasNext(), next(), remove() method.
Enumeration have hasMoreElement(), nextElement() method only

@iamutkarshtiwari
Copy link

@manishkaushik900 It seems to be fix here

@RushiBhatti
Copy link

---> 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants