Skip to content

Latest commit

 

History

History
12 lines (7 loc) · 629 Bytes

735a.md

File metadata and controls

12 lines (7 loc) · 629 Bytes

Back to questions

Solution to 735a: Generic iterators

See code at solutions/code/tutorialquestions/question735a

Making the iterator classes of question 1486 and question 8a61 generic is fairly straightforward: it basically just involves stripping out specific types and replacing them with generic ones. Compare the sample solutions to see this.

Extension: The sample solution provides a unifying interface, GenericCollection, that offers the iterator() method, and the GenericStack and GenericSet interfaces both extend GenericCollection.