Flash cards
Review the key moves
1/3
Core idea
What is the main idea behind Java Iterator Interface?
Lesson checks
Practice each idea before moving on
Short Mimo-style checks built from this lesson's code, terms, and sequence.
1Quick choice
Which statement best captures the main point of this lesson?
Iterator Methods
The Iterator interface provides methods to access and iterate through collections:
| Method | Description | Return Type |
|---|---|---|
| hasNext() | Returns true if there are more elements in the iteration | boolean |
| remove() | Removes the last element returned by next() | void |
Note
The next() method uses the type of the iterator's items as its return value. This type is referred to as T in the table.