title: Sublist Implementation
body: <p>I am implementing my own LinkedList class.</p>
  
  <p>For sublist(int a,int b function) method,mycode doesn't work properly.it should return sublist of list according to (a and b indexes)(which i succeed) also after this method if any change is made on sublist also list must be effected(not succeed).for example if i execute
  <code>(list.sublist(1,4)).clear</code> :list elements from 1 to 4  should clear also.
  My code is:</p>
  
  <pre><code>public List&lt;E&gt; subList(int arg0, int arg1) {
  
      ArrayList&lt;E&gt; ar = new ArrayList&lt;E&gt;(); 
  
      ListIterator myiter=listIterator(arg0);
  
      int k = arg1 - arg0 + 1;
      int i;
  
      for(i = 0; i &lt; k; ++i) {
          ar.add((E) myiter.next());
      }
  
      List &lt;E&gt; sublist=new GITLinkedList(ar);
      return sublist;
  }
  </code></pre>