what is diff bet iterator and enumeration?

Answers were Sorted based on User's Feedback



what is diff bet iterator and enumeration?..

Answer / muralisankar

Both are to navigate collection objects. But Enumerator you
can not manipulate where as in Iterator you can add and
remove objects.

Is This Answer Correct ?    8 Yes 1 No

what is diff bet iterator and enumeration?..

Answer / siva thimmannagari

Iterator supports only hasNext(),
next() and remove() methods.
It is not synchronized.


Enumeration supports ONLY
hasMoreElements(), nextElement().
It is synchronized.

Is This Answer Correct ?    1 Yes 0 No

what is diff bet iterator and enumeration?..

Answer / aslam

Iterator has an additional method remove() and also
iterator checks for the concurrent modifications which will
be useful in multi threaded applications.

while Enumerator is much faster for sequential
access over collection elements, because it doesnot have
the additional overhead of checking concurrent modifications

Is This Answer Correct ?    0 Yes 0 No

what is diff bet iterator and enumeration?..

Answer / raju

From my experiance shows Enumeration is thread safe ..

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More Core Java Interview Questions

explain the collection in java

1 Answers   WDC,


Why we use protected in java?

0 Answers  


What are keywords in java?

0 Answers  


Can we declare a class as abstract without having any abstract method?

0 Answers  


Which Component subclass is used for drawing and painting?

1 Answers  






how can you retrive information from database by using hashmap/arraylist ,plz explain with example briefly?

1 Answers   Satyam,


What are the two main uses of volatile in Java?

0 Answers  


What is the purpose of a parameter?

0 Answers  


What is e java?

0 Answers  


How does queue work in java?

0 Answers  


What is the difference between serial and throughput garbage collector?

0 Answers  


Is void a data type?

0 Answers  


Categories