in Education by
What is the difference between Iterator and Enumeration in JAVA?

1 Answer

0 votes
by

Following are the differences:- 

No. Iterator Enumeration
1) The Iterator can traverse legacy and non-legacy elements. Enumeration can traverse only legacy elements.
2) The Iterator is fail-fast. Enumeration is not fail-fast.
3) The Iterator is slower than Enumeration. Enumeration is faster than Iterator.
4) The Iterator can perform remove operation while traversing the collection. The Enumeration can perform only traverse operation on the collection.

Related questions

0 votes
    What is the difference between Array and ArrayList in JAVA?...
asked May 27, 2021 by JackTerrance
0 votes
    What is the Main difference between Iterator and Enumeration in JAVA?...
asked May 18, 2021 in Technology by JackTerrance
0 votes
    Which of the following option leads to the portability and security of Java? a) Bytecode is executed by ... stackoverflow.com 🔗Source: Java Interview Questions and Answers...
asked Dec 19, 2020 in Education by Editorial Staff
0 votes
    What is the difference between Iterator and ListIterator?...
asked May 26, 2021 in Technology by JackTerrance
0 votes
    The iterator maintains the __________ of its execution in between calls so that successive next() requests ... Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    Enumeration is done to gain information. Which of the following cannot be achieved using enumeration? (a) IP Tables ( ... questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 4, 2021 in Education by JackTerrance
0 votes
    Enumeration does not depend on which of the following services? (a) DNS enumeration (b) SNMP enumeration (c) NTP ... Security questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 4, 2021 in Education by JackTerrance
0 votes
    __________ suite is used for NTP enumeration. (a) DNS (b) NTP (c) HTTP (d) SNMP The question was posed to ... Cyber Security questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 4, 2021 in Education by JackTerrance
0 votes
    Network enumeration is the finding of __________ or devices on a network. (a) hosts (b) servers (c) network ... Security questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 4, 2021 in Education by JackTerrance
0 votes
    What is enumeration in ethical hacking?...
asked Feb 16, 2021 in Technology by JackTerrance
0 votes
    What is fast enumeration in Objective-C?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    What is difference between dequeue() and peek() function of java? (a) dequeue() and peek() remove and ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    I am importing a project from C to Java which involves a lot of floating-point arithmetic. Are there ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I am importing a project from C to Java which involves a lot of floating-point arithmetic. Are there ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
...