title: Java CARD Class compare method
body: <pre><code>int[] value = new int[5];
  boolean result = true;
  for(int i = 0; i &lt; 5; i++) {
      value[i] = cards[i].getValue();
  }
  for(int i = 0; i &lt; 5; i++) {
      for(int j = i;j &lt; 5; j++) {
          if(value[i] == value[j + 1]) {
              result = false;
          }
      }
  }
  return result;
  </code></pre>
  
  <p>This code is essentially going to compare the values each card object has, and if two cards in the array have the same value return true. We have 5 cards in each hand and that is why the array length is 5. The <code>getValue</code> method returns an integer which is essentially the value of the card. I don't seem to know what I'm doing wrong to be getting errors on my method.</p>