Why enumeration is faster than iterator?



Why enumeration is faster than iterator?..

Answer / Ayushi Singh

Enumeration may be faster than Iterator in some cases because it doesn't extend the ListIterator class and doesn't provide the ability to add or remove elements during iteration. However, this difference is generally negligible and both are efficient.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is the numeric promotion?

1 Answers  


Explain about method local inner classes or local inner classes in java?

1 Answers  


why constructor dont have returns type?

9 Answers   IBM,


suppose in a class there is a code like this: { Set hs=new Hashset(); hs.add(new Emp("kathy",1000)); hs.add(new Emp("kathy",2000)); } how can u avoid the above code in your class as set won't allow duplicate objects?

3 Answers  


What are File and RandomAccessFile classes?

2 Answers  


In what ways you can handle exception ?

3 Answers  


does java support default argument in Method?

1 Answers  


What is Servlet?

8 Answers  


Difference between abstract class and Interfaces?

7 Answers   CTS, iFlex, PA Consulting, Sai Softech, Value Chain,


What are the library functions in java?

1 Answers  


When does a class need a virtual destructor?

1 Answers   Flextronics,


what is connection pooling with example?

3 Answers   Amdocs,


Categories