linked lists linked list itself each link object contains reference (usually called nextto the next link in the list field in the list itself contains reference to the first link this relationship is shown in figure linked list link link link link data data data data next next next next first null figure links in list here' part of the definition of class link it contains some data and reference to the next linkclass link public int idatapublic double ddatapublic link next/data /data /reference to next link this kind of class definition is sometimes called self-referential because it contains field--called next in this case--of the same type as itself we show only two data items in the linkan int and double in typical application there would be many more personnel recordfor examplemight have nameaddresssocial security numbertitlesalaryand many other fields often an object of class that contains this data is used instead of the itemsclass link public inventoryitem iipublic link next/object holding data /reference to next link references and basic types you can easily get confused about references in the context of linked listsso let' review how they work