title: Linked Lists With No Imports
body: <p>I'm trying to create a linked list, either double or single without using any imports, it's part of a class project. but what i'm not understanding i guess is how to actually create and add an item to the list, without using java.util.
  I have </p>
  
  <pre><code>public boolean insertItem( ItemType newItem)
  {
      if( p==0 || m==MAX_LENGTH)
      {
          head.elem = elem;
          head.next = tail; 
          tail = head;
          return false;
      } 
      else
      {
          tail.next = new ListNode(); //adds new node to the end of the list
          tail = tail.next;//set the tail pointer to that node
          tail.elem = newItem;  //set elem to be stored to the end node
          m++;
          return true;
      }
  }
  </code></pre>
  
  <p>so i'd love some input on why this doesn't work. and how i actually create this list, i've been using an array just <code>Object list[] = new list[MAX_LENGTH]</code> but i'm not sure if that's the right way to go about it. </p>