1.

Which of these is a method of ListIterator used toobtain index of previous element?(a) previous()(b) previousIndex()(c) back()(d) goBack()The question was posed to me in homework.Origin of the question is Iterators in section java.util – The Collections Framework of Java

Answer»

The correct choice is (b) previousIndex()

For EXPLANATION I WOULD say: previousIndex() returns index of PREVIOUS ELEMENT. if there is no previous element then -1 is RETURNED.



Discussion

No Comment Found

Related InterviewSolutions