//other methods go here the constructor for linklist sets first to null this isn' really necessary becauseas we notedreferences are set to null automatically when they're created howeverthe explicit constructor makes it clear that this is how first begins when first has the value nullwe know there are no items on the list if there were any itemsfirst would contain reference to the first one the isempty(method uses this fact to determine whether the list is empty the insertfirst(method the insertfirst(method of linklist inserts new link at the beginning of the list this is the easiest place to insert link because first already points to the first link to insert the new linkwe need only set the next field in the newly created link to point to the old first link and then change first so it points to the newly created link this situation is shown in figure first next next next next null abefore insertion first next next next next null link next bafter insertion figure inserting new link