Which of the following is true? a. The ListIterator interface is a subinterface of the Iterator interface b. The ListIterator interface is a superinterface of the Iterator interface c. The ListIterator interface extends the List interface d. None of the above

Respuesta :

Answer:

Option (A) is the correct answer.

Explanation:

Iterator’ is an interface that allows to give access to the data member, traverse any collection and remove the data member from the collection. ListIterator interface is used to extend the Iterator interface before it has been used by the user because it is an interface defined in the "Iterator" interface. This line is also said by the option "a" in the question. hence option a is the right answer. Another option is not valid because-

  • Option b says that the Iterator interface is defined in the ListIterator interface which is wrong.
  • Option c suggests that the ListIterator interface is defined in the List interface which is also wrong.
  • Option d suggests that the given option is not correct but the option "a" is correct.