Asked by george brown on Jun 29, 2024

verifed

Verified

All of the following are methods of the Iterator interface except:

A) clear)
B) hasNext)
C) next)
D) remove)

Iterator Interface

An interface in Java that provides methods for iterating over any collection of objects, one element at a time.

Methods

Functions associated with an object in object-oriented programming, capable of performing specific actions or operations.

  • Understand the purpose and functionalities provided by the Iterator interface and methods of iteration over collection elements.
verifed

Verified Answer

CB
Chandamayee BrahmaJul 02, 2024
Final Answer :
A
Explanation :
The Iterator interface does not have a clear() method. It has hasNext(), next(), and remove() methods. hasNext() checks if there are more elements in the collection, next() returns the next element in the collection, and remove() removes the last element returned by next().