title: Repeating numbers
body: <p>I've been stuck with this for some time. I'm supposed to create a method, that counts how many of the numbers appear to be the same. As an example, 7-2-2-7 is supposed to be give 2, and 4-4-5-5 is supposed to give 2, while 1-2-3-4 gives 0. But my program gives me 3 when there are only 2 different numbers that are identical??? Help?</p>
  
  <pre><code>public class Help {
         public static void main(String[] args) {
            numRepeat(7, 2, 2, 7);
         }//main
         public static void numbers(int a, int b, int c, int d) {
            int rep = 0;
            int sum = 0;
               for (int i = 0; i &lt;= 1; i++) {
                  if (a == b || b == c || c == d) {
                     rep++;
                     sum += rep;
                  } else if (b == a || b == c || b == d) {
                     rep++;
                     sum += rep;
                  } else if (c == a || c == b || c == d) {
                     rep++;
                     sum += rep;
                  } else { /**do nothing**/ }
               }//for loop
            System.out.println("The sum of repeated digits is " + sum);
         }//numRepeat
      }//class
  </code></pre>