implement methods of an implemented List to an ArrayList
<p>I know what to do with my programming code, I just don't know why we have to do it. My ArrayList class implements a List interface. This means I have to copy all methods in my List interface to my ArrayList class. This is to stop the error of my ArrayList class saying: "ArrayList is not abstract and does not override abstract method iterator(int)" error. Can someone explain that to me in more detail?</p>

<p>Also: When I used the auto correct in NetBeans it says statements after each method "throw new UnsupportedOperationException("Not supported yet.");" why?</p>

<p>Here's my code:</p>

<pre><code>public class ArrayList&lt;E&gt; implements List&lt;E&gt; {
private E[] elementData;
private int elementCount;
private int capacityIncrement;
private static final int INVALID_INDEX=-1;
private static final int DEFAULT_CAPACITY = 100;

public ArrayList() {

    capacityIncrement = 0;
    elementData = (E[]) new Object[DEFAULT_CAPACITY];


}

public ArrayList(int capacity) {

    this.capacityIncrement = 0;
    this.elementData = (E[]) new Object[capacity];


}

public ArrayList(int capacity, int increment) {

    this.capacityIncrement = increment;
    this.elementData = (E[]) new Object[capacity];

}



private static class ArrayListIterator&lt;E&gt; implements Iterator&lt;E&gt; {
    private ArrayListIterator(ArrayList c) {

        elementData=c;

    }

public interface List&lt;E&gt; {

public int size();

public boolean isEmpty();   

public void clear();

public boolean contains(E element);

public void add(E element);

public boolean remove(E element);    

public E elementAt(int index);

 public int indexOf(E element);

public void insertElementAt(E element, int index);    

public void removeElementAt(int index);    

public void setElementAt(E element, int index);


public void removeDuplicates();

public void trimToSize();   

public Iterator&lt;E&gt; iterator();  

public Iterator&lt;E&gt; iterator(int index);

public String toString();

}
</code></pre>
