Question: I am having trouble finding pairs in a string of size five. So therefore, there can only be two pairs. For every pair that I have found, I should increase the score by 2 points.
Here is what I have so far, but it is incorrect.

```
  String  temp = "4 5 4 3 3";
  String  tempLine = temp.replaceAll(" ", "");
  String[]  hand = temp.split(" ");
        for(int i = 0; i < hand.length; i++)
                  {

                      if(hand[i].equals(tempLine.substring(0, 1)) && i !=0 )
                          score += 1;
                      if(hand[i].equals(tempLine.substring(1, 2)) && i != 1 )
                          score += 1;
                      if(hand[i].equals(tempLine.substring(2, 3)) && i!= 2 )
                          score += 1;
                      if(hand[i].equals(tempLine.substring(3, 4)) && i!= 3)
                          score += 1;
                      if(hand[i].equals(tempLine.substring(4)) && i != 4)
                          score += 1;

                  }

```

**EDIT: I am trying to find pairs in the hand that have similar value, for example 4 would be one pair found in this hand**

Answer: 
Create an actual `Hand` class and don't use `String`s to represent your cards. A `Card`'s rank and suit are suitable candidates for an `enum`:

```
class Card {
  enum Suite { ... };
  enum Rank { ... };

  private final Suite s;
  private final Rank r;

  // ...
}

class Hand {
  private Card[] cards;
  // ...
}

```

And sort the `Card[]` in your `Hand` class which makes it easier to evaluate . 

Checkout Oracle's `enum` tutorial which has an example with cards: <http://download.oracle.com/javase/1.5.0/docs/guide/language/enums.html>
1) Why aren't you comparing elements of the hand array to **other elements**? You already did the work to interpret the string and create the array data; use it.

2) There are more possible pairs of elements than that. Put down five similar objects in a row in front of you at the computer and try it out for yourself. You should be able to identify ten pairs. You should also be able to identify a pattern to how to find/label the pairs.