What is the difference between Enumeration and Iteration
interfaces? What is the way of to retreive the objects from
these interfaces ?
Answer Posted / suma
1.Enumeration interface applicable legacy implemented classes.
Iterator is applicable for all collection implemented classes.
2.Enumeration :While iterating the elements we are not
allowed to remove the objects just we can perform only read
operation
Iterator:While iterating we can perform removal also in
addition to read operation
3. Enumeration uses elements() method ,
Iterator uses iterator() method
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
Can we install jre without jdk?
I want to control database connections in my program and want that only one thread should be able to make database connection at a time. Define how can I implement this logic?
What are jpa annotations?
How do I start netbeans?
What is an entity in java?
What gives java it’s “write once and run anywhere” nature?
What is a java proxy?
What is transactional in java?
What is data encapsulation?
What is microservices java?
What is lambda expressions action func and predicate?
What is the difference between java se and java ee?
How should I format my code? How should I comment my code?
What is the use of lambda functions?
What is native class in java?