title: Why can't I use the compare() method without making my class abstract?
body: <p>I'm currently trying to get the hang of inheritance and implementation but I can't get my head around why I need to implement interfaces, and why they aren't just normal methods.
  Here is the code I'm currently writing that brought me to these questions, I'm trying to extend the ArrayList class so that elements are automatically sorted when entered.</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.*;
  import java.util.Comparator;
  /**
   * extending to ArrayList
   */
  public abstract class SortedArrayList&lt;E&gt; extends ArrayList&lt;E&gt; implements Comparator&lt;E&gt;
  {
  
  /**
   * Constructing the super
   */
  public SortedArrayList()    
  {
     super();
  
    }
  
    public  void insertAndSort (E element){
    if (isEmpty()){
        add(element);
      }
  
    for ( int i = 0; i &lt; size(); i++){
        E otherElement = get(i);
        if(compare(element, otherElement) &gt; 0){
            add(i+1, element);
          }
        if(compare(element, otherElement) &lt; 0) {
            add(i-1, element);
          }
      }
  
  }
  }
  </code></pre>
  
  <p>note: I'm aware it's bad practice to extend an arrayList, it's just something I have to do. Also I'm not allowed to use sort().</p>
  
  <p>I want to use the comparator to sort the ArrayList so I needed to implement it. However it wouldn't let me implement it without making the class abstract. I did so and although it meant I no longer get compiler errors I don't fully understand what it means to make an abstract class and what repercussions it will have. Am I doing the right thing?
  Thanks.</p>