each link here' the entire displaylist(methodpublic void displaylist(system out print("list (first-->last)")link current first/start at beginning of list while(current !null/until end of listcurrent displaylink()/print data current current next/move to next link system out println("")the end of the list is indicated by the next field in the last link pointing to null rather than another link how did this field get to be nullit started that way when the link was created and was never given any other value because it was always at the end of the list the while loop uses this condition to terminate itself when it reaches the end of the list figure shows how current steps along the list at each linkthe displaylist(method calls the displaylink(method to display the data in the link the linklist java program listing shows the complete linklist java program you've already seen all the components except the main(routine figure stepping along the list listing the linklist java program /linklist java /demonstrates linked list /to run this programc>java linklistapp ///////////////////////////////////////////////////////////////class link