Expert Solution & Answer
Book Icon
Chapter 25.5, Problem 25.5.1CP

Explanation of Solution

Iterator:

  • The uniform way of traversing the elements in a container is defined in the “Iterator” interface.
  • The “iterator ()” method is defined in the “java.lang.Iterable” interface.
  • This method will returns an instance of the “java.util.Iterator” interface.
  • The “java.util.Iterator” interface will defines the common features of iterators.

Example:

Consider the example of iterator which is given below:

//override method

public java...

Blurred answer
Students have asked these similar questions
How does concrete RTN differ from abstract RTN. Give examples.
What is Reentrancy?
Explain the design pattern followed by Iterator