linked lists reference in the list itselfas users of list classwhat we need is access to reference that can point to any arbitrary link this waywe can examine or modify the link we should be able to increment the reference so we can traverse along the listlooking at each link in turnand we should be able to access the link pointed to by the reference assuming we create such referencewhere will it be installedone possibility is to use field in the list itselfcalled current or something similar you could access link using current and increment current to move to the next link one problem with this approach is that you might need more than one such referencejust as you often use several array indices at the same time how many would be appropriatethere' no way to know how many the user might need thusit seems easier to allow the user to create as many such references as necessary to make this possible in an object-oriented languageit' natural to embed each reference in class object this object can' be the same as the list class because there' only one list objectso it is normally implemented as separate class an iterator class objects containing references to items in data structuresused to traverse these structuresare commonly called iterators (or sometimesas in certain java classesenumeratorshere' preliminary idea of how they lookclass listiterator(private link currentthe current field contains reference to the link the iterator currently points to (the term points as used here doesn' refer to pointers in ++we're using it in its generic sense to mean "refers to "to use such an iteratorthe user might create list and then create an iterator object associated with the list actuallyas it turns outletting the list create the iterator is easierso it can pass the iterator certain informationsuch as reference to its first field thuswe add getiterator(method to the list classthis method returns suitable iterator object to the user here' some abbreviated code in main(that shows how the class user would invoke an iteratorpublic static void mainlinklist thelist new linklist()listiterator iter thelist getiterator()/make list /make iter