In our experience, the biggest problem encountered by users of generic classes and methods are syntax errors. We hope that lab activities alerted you to the problems.
Various aspects of iterators cause trouble, mainly with the maintenance of the internal state of the iteration. The constructor initializes the state, typically to the position of the first item to be enumerated. Subsequent processing maintains a data invariant that relates the position of the most recently returned element to the number of items in the collection being enumerated. And a detail: the hasNext method should never change the state of the iterator.
Homework Submission
Submit the following files as hw8:
Homework Assignments
Read the following:
Don't forget to work on your project and study for the midterm!