title: finding the largest digit in an integer using recursion
body: <p>I have a practice who's task is to find the largest digit in an integer using recursion in java. For example, for the number 13441 the digit '4' will be returned.</p>
  
  <p>I have been trying for a day now and nothing worked. </p>
  
  <p>What I thought could work is the following code, which I can't quite get the "base case" for:</p>
  
  <pre><code>public static int maxDigit(int n) {
      int max;
      if (n/100==0) {
          if (n%10&gt;(n/10)%10) {
              max=n%10;
          }
          else
              max=(n/10)%10;
      }
      else if (n%10&gt;n%100)
          max=n%10;
      else
          max=n%100;
      return maxDigit(n/10);
  }
  </code></pre>
  
  <p>As you can see it's completely wrong.</p>
  
  <p>Any help would be great. Thank you</p>