listing linked lists continued system out println("can' find link")link thelist delete( )/delete item ifd !null system out println("deleted link with key idata)else system out println("can' delete link")thelist displaylist()/end main(/end class linklist app /display list ///////////////////////////////////////////////////////////////the main(routine makes listinserts four itemsand displays the resulting list it then searches for the item with key deletes the item with key and displays the list again here' the outputlist (first-->last){ { { { found link with key deleted link with key list (first-->last){ { { the find(method the find(method works much like the displaylist(method in the linklist java program the reference current initially points to first and then steps its way along the links by setting itself repeatedly to current next at each linkfind(checks whether that link' key is the one it' looking for if the key is foundit returns with reference to that link if find(reaches the end of the list without finding the desired linkit returns null the delete(method the delete(method is similar to find(in the way it searches for the link to be deleted howeverit needs to maintain reference not only to the current link (current)but to the link preceding the current link (previousit does so becauseif it deletes the current linkit must connect the preceding link to the following linkas shown in figure the only way to tell where the preceding link is located is to maintain reference to it