arbitrary link this allows us to 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 currentand increment current to move to the next link one trouble 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 thus it 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 can' be the same as the list classbecause there' only one list object an iterator class objects containing references to items in data structuresused to traverse data 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 "pointsas used here doesn' refer to pointers in ++we're using it in its generic sense to use such an iteratorthe user might create list and then create an iterator object associated with the list actuallyas it turns outit' easier to let the list create the iteratorso it can pass the iterator certain informationsuch as reference to its first field thus we 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()link alink iter getcurrent()iterator iter nextlink()/make list /make iter /access link at /move iter to next link once we've made the iterator objectwe can use it to access the link it points toor increment it so it points to the next linkas shown in the second two statements we call the iterator object iter to emphasize that you could make more iterators (iter and so onthe same way the iterator always points to some link in the list it' associated with the listbut it' not the same as the list figure shows two iterators pointing to links in list