title: Issues overriding add
body: <p>I'm writing a program that's supposed to sort an arrayList, but whenever I override the add function, I get this message : "add(Java.lang.String) in SortedList cannot implement add(E) in java.util.List; attempting to use incompatible return type found : void required: boolean"</p>
  
  <p>I'm not really sure what I'm doing wrong. Below is my code. Thanks in advance!</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.List;
  import java.lang.String;
  
  public class SortedList extends ArrayList&lt;String&gt;
  {
      private ArrayList&lt;String&gt; a;
  
      public SortedList()
      {
          super();
      }
      public SortedList(int cap)
      {
          super(cap);
      }
      public void add(String x)
      {
          for(int i=0; i&lt;a.size(); i++)
              if(x.compareTo(a.get(i))&gt;=0 &amp;&amp; x.compareTo(a.get(i+1))&lt;=0)
                  super.add(x);
      }
  }
  </code></pre>