What is the differenc between Enemuration interface and
iterator interface according to accessing?
Answers were Sorted based on User's Feedback
Answer / ravikiran
Enumeration contains elements method for iteration.
And hasMoreElements and nextelement() methods to get the
values from the collection.
Iterator contains iterator() method for iteration
And hasnext() and next() methods for the retrieval of
values from the collection.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / muthuraman
Enumeration is a read only interface, by using this we can
loop thro' the elements only. But using iterator interface
we can traverse and also remove the object.
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / suresh gangapatnam
While iteration we can remove the elements but it's not in
case enumeration and Enumeration is faster than the
iteration.
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / eganesh
Enumeration and Iterator both are using looping statement.
Enumeration is legacy class.iterator is cotains extra
method than Enumeration.
Is This Answer Correct ? | 0 Yes | 2 No |
What are virtual functions?
How we can generate random numbers in java?
i need to know the website that i can compile and run a java code in online.(while system doesn't contain any jdk and jre)
What is the char data type?
How we can run a jar file through command prompt in java?
What is the protected method modifier?
What is finalize()?
How can you make sure that your singleton class will always return single instance in multi-threaded environment?
How many times finalize method will be invoked? Who invokes finalize() method in java?
How many bits does a boolean take?
what is the difference between String s="hello"; and String s=new String("hello");?
Which class is the superclass for every class in java programming?