although not shown hereyou should check with isempty(to be sure the list is not empty before calling getcurrent(the following code shows how you could delete all items with keys that are multiples of we show only the revised main(routineeverything else is the same as in interiterator java class interiterapp public static void main(string[argsthrows ioexception linklist thelist new linklist()/new list listiterator iter thelist getiterator()/new iter iter insertafter( )iter insertafter( )iter insertafter( )iter insertafter( )iter insertafter( )/insert links thelist displaylist()/display list iter reset()link alink iter getcurrent()if(alink ddata = iter deletecurrent()while!iter atend(iter nextlink()/start at first link /get it /if divisible by /delete it /until end of listalink iter getcurrent()if(alink ddata = iter deletecurrent()thelist displaylist()/end main(/get link /if divisible by /delete it /go to next link /display list /end class interiterapp we insert five links and display the list then we iterate through the listdeleting those links with keys divisible by and display the list again here' the output againalthough this code doesn' show itit' important to check whether the list is empty before calling deletecurrent(other methods