title: how to recursively insert a node at a certain index in a linked list
body: <p>I am sort of still new at programming so be generous on your explanations. I'm having trouble implementing the insertAt method recursively. Basically what I need it to do is to insert Object elem into the index of the list without using any loops.</p>
  
  <pre><code>public class ListInterfaceImplementation implements ListInterface{
  
  private ListNode first;
  private ListNode last;
  private ListNode current;
  private int size = 0;
  
  public ListInterfaceImplementation(){
  }
  
  public ListInterface insertAt(int index, Object elem) {
      // TODO Auto-generated method stub
      ListNode cur = new ListNode(current);
      if(index &lt; 0){
          throw new IndexOutOfBoundsException();
      }
      if(elem == null){
          throw new NullPointerException();
      }
      if(index == 0){
          ListNode node = new ListNode(elem);
          node.getNext() = current.getNext();
          current.getNext() = node;
          size++;
          return this;
      }
      cur = current.getNext();
      return insertAt(index -1, elem);
  
  }
  </code></pre>
  
  <p>This is what I have so far.</p>