Implementing the Comparable Interface homework
<p>I am a beginner at computer programming and I am working with Java.
For my homework assignment I was instructed to create a contact book according to the following specifications:</p>

<ol>
<li><p>First, a contact is defined as the tuple: firstName, lastName, phoneNumber and email. </p></li>
<li><p>You will create a class Contact that allows getting and setting of these variables as well as a toString() method and an equals() method. <strong>The class Contact should implement the Comparable interface.</strong> </p></li>
<li><p>You will create a class ArrayOperation with a static method that sorts uni-dimensional array of objects that implement the Comparable interface </p></li>
<li><p>Next, a ContactBook class should be able to search, create and produce a String with all the sorted Contacts.  </p></li>
<li><p>A main class (call it whatever you want) should offer a menu asking how many contacts to create and then offer the three options above. </p></li>
<li><p>When adding, the input from the user is gathered and the method ContactBook.addContact(Contact c) will store that contact in memory. </p></li>
<li><p>If the user is searching, the program asks the user for all of the contact information and using the equals method searches for the desired contact.  The program quits when the user presses "q"</p></li>
</ol>

<p>I am having trouble implementing the Comparable interface.
This is what I have so far:</p>

<pre><code>public class Contact implements Comparable
{
  private String firstName, lastName, phoneNumber, email;

  public void setFirstName(String fName){firstName = fName;}
  public void setLastName(String lName){lastName = lName;}
  public void setPhoneNumber(String num){phoneNumber = num;}
  public void setEmail(String email){this.email = email;}

  public String getFirstName(){return firstName;}
  public String getLastName(){return lastName;}
  public String getPhoneNumber(){return phoneNumber;}
  public String getEmail(){return email;}

  public String toString()
  {
    return "First Name: " + firstName +
           "\nLast Name: " + lastName +
           "\nPhone Number: " + phoneNumber +
           "\nEmail: " + email;
  }

  public boolean equals(Contact cont)
  {
    return this.firstName.equals(cont.firstName) &amp;&amp;
           this.lastName.equals(cont.lastName) &amp;&amp;  
           this.phoneNumber.equals(cont.phoneNumber) &amp;&amp;
           this.email.equals(cont.email);
  }

  public int compareTo(Contact cont)
  {
    if(this.firstName.equals(cont.firstName) &amp;&amp;
           this.lastName.equals(cont.lastName) &amp;&amp;  
           this.phoneNumber.equals(cont.phoneNumber) &amp;&amp;
           this.email.equals(cont.email))
      return 0;
    return 1;
  }
}
</code></pre>

<ul>
<li>Every time I compile the code, the compiler shows an error that says
my class is not abstract even though it shouldn't have to be
abstract.</li>
<li>Also, I frankly do not know what to do with the compareTo() method. I
want to compare two instances of my Contact class but I am unable to
use "this.Contact" in the compareTo method.</li>
<li>Finally, I am confused about what to compare when returning -1 and 1
for the compareTo() method.</li>
</ul>
