in Education by
Which of these is a method of ListIterator used to obtain 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 Select the correct answer from above options

1 Answer

0 votes
by
 
Best 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.

Related questions

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
    Which of these method Map class is used to obtain an element in the map having specified key? (a) ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these is an incorrect form of using method max() to obtain a maximum element? (a) max( ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method of Locale class can be used to obtain country of operation? (a) getCountry() (b) ... Utility Classes of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which of these method is used to make a bit zero specified by the index? (a) put() (b) set() (c ... - The Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method is used to add an element to the start of a LinkedList object? (a) add() (b ... The 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 can be used to obtain set of all keys in a map? (a) getAll() (b) getKeys( ... The 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
    Which of this method is used to change an element in a LinkedList Object? (a) change() (b) set() ... The 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 can be used to delete the last element in a LinkedList object? (a) remove() (b ... 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 can be used to move to next element in a collection? (a) next() (b) move() ... The 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 sets every element of a List to a specified object? (a) set() (b) fill() ( ... The Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method of HashSet class is used to add elements to its object? (a) add() (b) Add() ... The Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method is used to remove all keys/values pair from the invoking map? (a) delete() (b) ... Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of these method is used to insert value and its key? (a) put() (b) set() (c) insertElement( ... The Collections Framework of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
...