intro programming on java with compareTo : <p>just got some computer science from my friend,  I believe it is a intro to programming assignment, and I was trying on it, but it seems there are so many issue, seems I am majoring CS, can someone help me on those questions step by step, would be appreciated.  in instructions are following:</p>

<p>Create  a   public  class   Movie with  private instance    variables   String title
and int year. The   class   should  declare that    it  implements  the 
Comparable interface,    and should  provide the following:</p>

<p>• A constructor that    takes   2   arguments:  a   String  and an  int (in that    order)<br>
for initializing    title and   year.</p>

<p>• A method  that    satisfies   the Comparable interface.    Movies  should  be  compared    first   by  title   and then    by  year.</p>

<p>{ The   Maltese Falcon  1941,               The Thomas  Crown   Affair  1968,           The Thomas  Crown   Affair 1999}</p>

<p>An  equals()    method  that    is  compatible  with    the method  that    satisfies   the 
Comparable interface.</p>

<p>• A toString()  method  that    prints  “Movie” followed    by  1   space   followed    by<br>
the title   followed    by  1   space   followed    by  open-parenthesis    followed    by<br>
the year    followed    by  close-parenthesis.  Example:
                                                                                                                                                            The Maltese Falcon  (1941)</p>

<p>• A public  static method   getTestMovies(),    which   returns an  array   of  10<br>
unique  Movie   instances.  The 0th and 1st array   elements    must    be 2    movies<br>
with    the same    title   but from    different   years   (e.g.   The Thomas  Crown<br>
Affair  1968    and The Thomas  Crown   Affair  1999,   or  True    Grit    1969    and 
True    Grit    2010).  The 2nd and 3rd elements must   2   movies  with    different<br>
titles  but from    the same    year    (e.g.   The Martian 2015    and Bridge  of  Spies<br>
2015).  The 4th and 5th elements    must    be  2   different   objects that<br>
represent   the same    movie.</p>

<p>• A hashCode()  method. Use the following:</p>

<pre><code>public int hashCode()
{
return title.hashCode() + year;
 }
</code></pre>

<p>the following is what I have so far, I have the constructor and the starter, but I am sure how to do it.</p>

<pre><code>public class Movie implements Comparable&lt;Movie&gt;{
private String title;
private int year;

public Movie(String title, int year){
    this.title = title;
    this.year = year;
}

@Override
public int compareTo(Movie that) {
    int value = 0;
    if(this.title == that.title)
    {
        if(this.year &lt; that.year){
            value = 0;
        }
        else{
            value = -1;
        }
    }
    return value;
}

public static void getTestMovie(){

}

public boolean equals(Object x)
{
</code></pre>

<p>}
}</p>

<p>Any Helps are appreciated!</p>
