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 are the new features about Java se 8 ?

524


Why sun introduce concept of anonymous class? What is need and real life use of anonymous class

1775


What is jndi datasource in java?

473


What do you mean by exception handling?

487


What's the difference between local, global and universal groups? : java security

502






Can we write lambda without functional interface?

459


What is orm in java?

506


what are the different phases in delivering the project during development and maintenance?

4143


What is dialect in java?

467


What are jpa annotations?

480


If you’re overriding the method equals() of an object, which other method you might also consider?

520


What is the use of flatmap in java 8?

463


What is the difference between ec2 and lambda?

480


can anyone tell me what kind of questions are asked for core java exam in aptech

1457


What is web xml java?

513