what is diff bet iterator and enumeration?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Answer / raju
From my experiance shows Enumeration is thread safe ..
| Is This Answer Correct ? | 1 Yes | 4 No |
explain different ways of using thread? : Java thread
What are the differences between unchecked exception, checked exception, and errors?
What is the use of singleton?
Explain about field hiding in java?
Why local variables are stored in stack?
How do you use substring in java?
What is the mapping mechanism used by java to identify IDL language?
Is java a virus?
How do you create an array in java?
Explain JPA in Java.
Why there is no call by reference in java?
What is binary search in java?