title: Finding the highest number of recurring digits of a number
body: <p>I'm doing college course exercises, and I just can't seem to do one of them.
  We're asked to enter a number, like 1975333, and the program is supposed to return "Number 3 appears 3 times". It's basically supposed to tell you the mode of the number.</p>
  
  <p>This is what I have, but I can't seem to make it to work, no matter what I try: </p>
  
  <pre><code>import static java.lang.System.*;
  import static javax.swing.JOptionPane.*;
  import static java.lang.Math.*;
  
  public class Oblig5 {
  
      public static void main(String[] args) {
  
          int tall = input_tall();
          int siffervekt = 0;
          int t_siffervekt = 0;
  
          int lengde = (int) (Math.log10(tall) + 1);
  
          for (int siffer = 0; siffer == lengde; siffer++) {
              System.out.println("Siffer = " + siffer);
                  for (int x = 0; x &lt; lengde; x++) {
                      int asiffer = (tall % 10);
                      System.out.println("Asiffer = " + asiffer);
                      if (asiffer == siffer) {
                          siffervekt++;
                          out.println(siffervekt);
                      }
                      tall = tall / 10; 
                  }
              t_siffervekt = max(siffervekt, t_siffervekt);   
          }
      }
  
      private static int input_tall() {
          return Integer.parseInt(showInputDialog(null, "Skriv inn ønsket tall"));
      }
  
  }
  </code></pre>