Example & Tutorial understanding programming in easy ways.

What are difference between Iterator and ListIterator?

Following are some difference as :

                                                  Iterator                                           ListIterator
1 Use Iterator to traverse Set, List and also Map Objects. 1 Use ListIterator to traverse list objects.
2 Iterator iterate elements of collection in the forward direction only. 2 ListIterator iterate elements of collection in the forward and backward direction.
3 Iterator cannot add elements to collection. 3 ListIterator can add elements to collection.
4 Iterator can't replace existing object with new object. 4 ListIterator can replace existing object with new object.
5 Iterator can't get index of elements. 5 ListIterator get index of elements list.


Read More →
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!