Enumeration | Iterator | ListIterator | |
Where we can apply | – We can apply it on legacy classes only | – We ca apply it on any collection class | – We can apply it on list objects only |
Is it legacy | – Yes version 1.0 | -No version 1.2 | – No version 1.2 |
Movemenet | Single direction | Single direction | Bi-direction |
Allowed Operator | Only read | Read & Remove | Read, Remove, Replace, Add |
How to get it | by using enumeration() method | By using iterator() method of Collection Interface | By using listIterator() method of List interface |
Methods | hasNextElement() nextElement() | hasNext() next() remove() | hasNext() next() nextIndex() hasPrevious() pervious() previousIndex() add(Object 0) remove() replace(Object 0) |