title: removing even indexes' values in a linked list
body: <p>i'm writing  a method removeEvens that removes the values in even-numbered indexes from a list, returning a new list containing those values in their original order.  The deal is that i'm implementing my own linked list, i cannot use the LinkedList from <code>java.util</code>.</p>
  
  <p>For example, if a variable <code>list1</code> stores these values:</p>
  
  <pre><code>**list1: [8, 13, 17, 4, 9, 12, 98, 41, 7, 23, 0, 92]**
  And the following call is made:
  
  **LinkedIntList list2 = list1.removeEvens();** 
  After the call, list1 and list2 should store the following values:
  
  **list1: [13, 4, 12, 41, 23, 92]
  list2: [8, 17, 9, 98, 7, 0]**
  </code></pre>
  
  <p><strong>the method is in this linked list class</strong>:</p>
  
  <pre><code>public class LinkedIntList {
      private ListNode front;   // null for an empty list
      ...
  }
  </code></pre>
  
  <p><strong>Fields from ListNode class:</strong></p>
  
  <pre><code>public int data;          // data stored in this node
  public ListNode next;     // link to next node in the list
  </code></pre>
  
  <p><strong>My code (UPDATED)</strong>:</p>
  
  <pre><code>public LinkedIntList removeEvens(){
      LinkedIntList b = new LinkedIntList();
      b.front = front;
      if(front == null) {  
          System.out.println("The list inputed it empty");
      }
      else {   
          ListNode even = b.front;
          while(even!=null &amp;&amp; even.next!=null ) { 
              int toBeAdded = even.next.data;
              even.next = even.next.next;
              add(toBeAdded);
              even = even.next;
          }
      }
      return b;
  }
  </code></pre>
  
  <p><strong>My output</strong>:<br>
  <img src="https://i.stack.imgur.com/bayTa.png" alt="enter image description here"></p>
  
  <p><strong>UPDATED OUTPUT:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/cl8c1.png" alt="enter image description here"></p>
  
  <p>It seems like i have stored the values of even-numbered indexes in a new list (list2), but how do i store the remaining values (of odd-numbered indexes) in the original list (list1)?</p>