title: Deep Copying a generic LinkedList in Java
body: <p>I am trying to create a method that deep copies my linked list. In my get(index) method I am creating a new Node. Still this isn't working but it's passing the reference. </p>
  
  <pre><code>        SLinkedList&lt;E&gt; newLinkedList=new SLinkedList&lt;E&gt;();
  
          for(int i=0;i&lt;size();i++)
          {
          newLinkedList.addLast(get(i));
          }
          return newLinkedList;
      }
  </code></pre>