Kotlinlearncs.online LogoJava
Return to List

Homework: ArrayList Iterator

Created By: Chris Taylor
/ Version: 2023.8.0

Create a class, SimpleArrayListIterator that extends the SimpleArrayList and implements the Iterable<Object> interface. You will need to create an inner class that implements the Iterator<Object> interface.

Recall that the SimpleArrayList class has the following methods that may be of use to you:

  • SimpleArrayList(Object[] elements) - Constructor that accepts an array of elements
  • Object get(int index) - returns the element at the location specified by index

Related Lessons

Stuck? You may find these lessons helpful: