in Technology by
What is the difference between Iterator and ListIterator?

1 Answer

0 votes
by

Iterator traverses the elements in the forward direction only whereas ListIterator traverses the elements into forward and backward direction.

No. Iterator ListIterator
1) The Iterator traverses the elements in the forward direction only. ListIterator traverses the elements in backward and forward directions both.
2) The Iterator can be used in List, Set, and Queue. ListIterator can be used in List only.
3) The Iterator can only perform remove operation while traversing the collection. ListIterator can perform ?add,? ?remove,? and ?set? operation while traversing the collection.

Related questions

0 votes
    What is the Main difference between Iterator and Enumeration in JAVA?...
asked May 18, 2021 in Technology by JackTerrance
0 votes
    What is the difference between Iterator and Enumeration in JAVA?...
asked May 26, 2021 in Education by JackTerrance
0 votes
    The iterator maintains the __________ of its execution in between calls so that successive next() requests ... Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    Which of these is a method of ListIterator used to obtain index of previous element? (a) previous() (b ... Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these is a method of ListIterator used to obtain index of previous element? (a) previous() ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    This question already has answers here: Generic iterator (3 answers) Closed 7 years ago. Suppose I want to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: Generic iterator (3 answers) Closed 7 years ago. Suppose I want to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: Generic iterator (3 answers) Closed 7 years ago. Suppose I want to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 15, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: Generic iterator (3 answers) Closed 7 years ago. Suppose I want to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 13, 2022 in Education by JackTerrance
0 votes
    Which of these return type of hasNext() method of an iterator? (a) Integer (b) Double (c) Boolean (d ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these methods is used to obtain an iterator to the start of collection? (a) start() (b) ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Consider following piece of code void foo( bool forwad ) { vector::iterator it, end_it; int dir; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    Consider following piece of code void foo( bool forwad ) { vector::iterator it, end_it; int dir; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 17, 2022 in Education by JackTerrance
0 votes
    Which of these return type of hasNext() method of an iterator? (a) Integer (b) Double (c) Boolean ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these methods is used to obtain an iterator to the start of collection? (a) start() (b) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
...