public inventoryitem iipublic link next/object holding data /reference to next link figure links in list references and basic types it' easy to get confused about references in the context of linked listsso let' review how they work it may seem odd that you can put field of type link inside the class definition of this same type wouldn' the compiler be confusedhow can it figure out how big to make link object if link contains link and the compiler doesn' already know how big link object isthe answer is that link object doesn' really contain another link objectalthough it may look like it does the next field of type link is only reference to another linknot an object reference is number that refers to an object it' the object' address in the computer' memorybut you don' need to know its valueyou just treat it as magic number that tells you where the object is in given computer/operating systemall referencesno matter what they refer toare the same size thus it' no problem for the compiler to figure out how big this field should beand thereby construct an entire link object note that in javaprimitive types like int and double are stored quite differently than objects fields containing primitive types do not contain referencesbut actual numerical values like or variable definition like double salary creates space in memory and puts the number into this space howevera reference to an objectlike link alink somelinkputs reference to an object of type linkcalled somelinkinto alink the somelink object isn' movedor even createdby this statementit must have been created before to create an object you must always use newlink somelink new link()