title: Generics and Comparable and Comparator... Syntax error, insert ";" to complete LocalVariableDeclarationStatement"
body: <p>This question deals with generics and using the Comparable and Comparator interfaces.</p>
  
  <p>I have a class Chocolate:</p>
  
  <pre><code>public class Chocolate implements Comparable&lt;Chocolate&gt; {
  
      public int compareTo(Chocolate c) {
          if (this.getValue() &gt; c.getValue()) {
              return 1;
          } else if (this.getValue() &lt; c.getValue()) {
              return -1;
          } else {
              return 0;
          }
      }
  }
  </code></pre>
  
  <p>and a class Pair</p>
  
  <pre><code>public abstract class Pair&lt;E extends Comparable&lt;E&gt;, T extends Comparable&lt;T&gt;&gt;
      implements Comparable&lt;Pair&lt;E, T&gt;&gt; { 
  
      public int compareTo(Pair&lt;E, T&gt; p) {
          if (this.first.compareTo(p.first) &gt; 0) {
              return 1;
          } else if (this.first.compareTo(p.first) &lt; 0) {
              return -1;
          } else {
              if (this.second.compareTo(p.second) &gt; 0) {
                  return 1;
              } else if (this.second.compareTo(p.second) &lt; 0) {
                  return -1;
              }
          }
          return 0;
      }
  }
  </code></pre>
  
  <p>And another class Sorter with a main method</p>
  
  <pre><code>public class SortingClient {
  
      public static void main(String[] args){
  
          Pair&lt;Chocolate, Chocolate&gt;[] pairs = (Pair&lt;Chocolate, Chocolate&gt;[]) new Pair&lt;?,?&gt;[numPairs];
  
          Comparator&lt;Pair&lt;Chocolate, Chocolate&gt;&gt; interfaceChocolate = new Comparator&lt;Pair&lt;Chocolate, Chocolate&gt;&gt;(){
              public int compare(Pair&lt;Chocolate,Chocolate&gt; c1, Pair&lt;Chocolate,Chocolate&gt; c2){
                  if (c1.compareTo(c2) &gt; 0){
                      return 1;
                  }
                  else if (c1.compareTo(c2) &lt; 0){
                      return -1;
                  }
                  else {
                      return 0;
                  }
              }
          } * Error here*
      }
  </code></pre>
  
  <p>I get an <em>Error</em> at the second to last line marked saying "Syntax error, insert ";" to complete LocalVariableDeclarationStatement" What does this error mean, and how can I fix it?</p>