linked lists current display()and you've forgotten whether current is link objecta linklist objector something else the constructor initializes the data there' no need to initialize the next field because it' automatically set to null when it' created (howeveryou could set it to null explicitlyfor clarity the null value means it doesn' refer to anythingwhich is the situation until the link is connected to other links we've made the storage type of the link fields (idata and so onpublic if they were privatewe would need to provide public methods to access themwhich would require extra codethus making the listing longer and harder to read ideallyfor security we would probably want to restrict link-object access to methods of the linklist class howeverwithout an inheritance relationship between these classesthat' not very convenient we could use the default access specifier (no keywordto give the data package access (access restricted to classes in the same directory)but that has no effect in these demo programswhich occupy only one directory anyway the public specifier at least makes it clear that this data isn' private in more serious program you would probably want to make all the data fields in the link class private the linklist class the linklist class contains only one data itema reference to the first link on the list this reference is called first it' the only permanent information the list maintains about the location of any of the links it finds the other links by following the chain of references from firstusing each link' next fieldclass linklist private link first/ref to first link on list /public void linklist(/constructor first null/no items on list yet /public boolean isempty(/true if list is empty return (first==null)