What is the difference between cursors ...

What is the difference between cursors like ListIterator, Iterator and enumeration.


5 Answers
1-5 of  5
5 Answers
  • In numerous texts, I've seen the term cursor used interchangeably with the term iterator. However, it doesn't seem right that they are treated as the same thing. To me, an iterator allows iteration of a container with no knowledge of the container itself. A cursor, on the other hand, allows iteration of a container as well but has implementation details specific to the container type, so it does keep a reference to the container. Additionally a cursor's interface mirrors the interface of the container kind of like the facade pattern.

  • We need more Java knowledge to wirte servlet programs and it doesn't support tag based programming,in we need to handle the exceptions where as Jsp is tag based programming soo we don't need much Java knowledge and it handles exceptions internally.

  • Basically enumeration is designed for iterating leagacy classes like vector and stack. And it is called as forward directional cursor.and then list iterator comes for iterating all the collection classes objects and only difference is it has more functionality the previous one. Now the list iterator is bidirectional cursor that can iterat in both directions.

Core Java

Didn't get the answer.
Contact people of Talent-Core Java directly by clicking here