title: How to apend a linkedlist onto a specific node of a linkedlist?
body: <p>I want to know how to add a linkedlist to a specific index of another linkedlist. Picture of what I'm trying to do:</p>
  
  <p><a href="https://i.imgur.com/1UEEeUI.png" rel="nofollow noreferrer"><img src="https://i.imgur.com/1UEEeUI.png" alt="enter image description here"></a></p>
  
  <p>I want to add <code>item</code> to "John". <code>item2</code> to "Amy" and etc</p>
  
  <p>My code so far:</p>
  
  <pre><code>import java.util.*;
  public class LinkedListTest {
       public static void main(String args[]) {
  
           LinkedList&lt;String&gt; person = new LinkedList&lt;String&gt;();
           LinkedList&lt;String&gt; item = new LinkedList&lt;String&gt;();
           LinkedList&lt;String&gt; item2 = new LinkedList&lt;String&gt;();
  
           person.add("John");
           person.add("Amy");
           person.add("Bob");
           person.add("Michael");
  
  
           item.add("Eggs");
           item.add("Bread");
           item.add("Ham");
  
           item2.add("Toilet roll");
           item2.add("Eggs");
  
  
           for(int i = 0; i &lt; item.size(); i++){
           person.addFirst(item.get(i));
           }
           System.out.println(person);
  
       }
  }
  </code></pre>