title: Java: Check if every single digit of a number is within a range
body: <p>I am making a method of a class that takes two integers as arguments. It checks every single digit of the first one and makes sure they are less than or equal to the second one.</p>
  
  <pre><code>public static boolean digitRange(int x, int limit) {
      String number= Integer.toString(x);
      char[] digits=number.toCharArray();
      boolean result=false;
      for(char c: digits) {
          if(Integer.parseInt(String.valueOf(c))&gt;limit) {
              result=false;
          }
      }
      return result;
  }
  </code></pre>
  
  <p>The expected output for say 0 and 5 would be:</p>
  
  <pre><code>public static void main(String[] args){
      System.out.println(digitRange(0,5));//0 is les than or equal to 5. 
                                          //Therefore true is printed. 
  } 
  </code></pre>
  
  <p>However, I am getting false in every single scenario and I cannot find why.
  Could someone help me correct the digitRange method, please.</p>