So I'm fairly new to Java and programming and I was wondering how to create a node class? So far I have:
public class ItemInfoNode < private ItemInfoNode next; private ItemInfoNode prev; private ItemInfo info; public ItemInfoNode(ItemInfo info, ItemInfoNode next, ItemInfoNode prev)< info = info; next = next; prev = prev; >public void setInfo(ItemInfo info) < info = info; >public void setNext(ItemInfoNode node) < next = node; >public void setPrev(ItemInfoNode node) < prev = node; >public ItemInfo getInfo() < return info; >public ItemInfoNode getNext() < return next; >public ItemInfoNode getPrev() < return prev; >>
Pretty much the question asked for those methods so I put those down but, the next question asks me to refer to the head and tail of ItemInfoNode nodes. Just a bit confused here. Thanks EDIT: Thanks for the help guys! I'm trying to create an "InsertInfo" method that puts information like the name, price, tag number, etc. Into one node. How do I go about creating this method? So far I got this.. I have an Iteminfo constructor in a different class that has all of these but, I'm not sure how to use that/if I am even supposed to do..
public void InsertInfo(String name, String rfdnumber, double price, String original_position)