additional iterator features we've seen several programs where the use of previous field made it simpler to perform certain operationssuch as deleting link from an arbitrary location such field is also useful in an iterator alsoit may be that the iterator will need to change the value of the list' first fieldfor exampleif an item is inserted or deleted at the beginning of the list if the iterator is an object of separate classhow can it access private fieldsuch as firstin the listone solution is for the list to pass reference to itself to the iterator when it creates it this reference is stored in field in the iterator the list must then provide public methods that allow the iterator to change first these are linklist methods getfirst(and setfirst((the weakness of this approach is that these methods allow anyone to change firstwhich introduces an element of risk here' revised (although still incompleteiterator class that incorporates these additional fieldsalong with reset(and nextlink(methodsclass listiterator(private link currentprivate link previousprivate linklist ourlist/reference to current link /reference to previous link /reference to "parentlist public void reset(/set to start of list current ourlist getfirst()/current --first previous null/previous --null public void nextlink(/go to next link previous current/set previous to this current current next/set this to next