title: Contact cannot be cast to java.lang.Comparable
body: <p>i have been trying hard to spot my error but to no avail. can someone help me?
  I am sure that I am comparing the correct objects</p>
  
  <pre><code>    Contact[] sortedList = myContactList.sortContactsByName();
      for (Contact c : sortedList) {
          // TODO using this line means you need to implement what in Contact class?
          // Hint: You need to override a method inherited from Object.
  
          System.out.println(c);
      }
  }
  
  
  
  public Contact[] sortContactsByName() {
      Contact[] contactArray = contacts.toArray(new Contact[contacts.size()]);
      // TODO Contact class has to implement Comparable
      // interface for this to work!
  
      Arrays.sort(contactArray);
      // Don't bother how it works now, sorting in Java
      // will be covered later on.
      return contactArray;
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>public int compareTo(Contact o1){
  
      return this.name.compareTo( o1.name);
  </code></pre>