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


Please Help Members By Posting Answers For Below Questions

What do I need to install netbeans?

587


Which is faster c++ or java?

584


Why are command line arguments passed as a string?

571


Which interceptor is responsible for setting action javabean properties?

507


Explain issues of old java date api?

619






What is java flatmap?

549


What is java bean class?

565


How do you run an executable jar file?

538


Do I really have to type in the programs in the book to try them out?

653


What if I do not provide the string array as the argument to the method?

573


Is it correct to say that using parentheses can only change?

560


Is jvm a compiler or an interpreter?

614


What is the use of servlet in java?

604


How do you type the lambda symbol?

562


Are streams faster than for loops?

563