title: Convert char to int and find the difference using java
body: <p>Suppose i have a number as 68, then this number should give me answer as 2. basically I am trying to find the difference of this number i.e.. 6-8 = -2 (actually i want to ignore if it is +2 or -2). My code should follow these steps 
  1.Convert number into String
  2.Extract each char using charAt method
  3.Convert char to int and find the difference
  Here is my code</p>
  
  <pre><code>    int number = 68, convertInt, difference;
      String str = String.valueOf(number);
      char ch = 0;
  
      for(int a=0; a&lt;str.length(); a++){
          ch = str.charAt(a);
          convertInt = Character.getNumericValue(ch);
          // here I'm unable to do the difference
      }  
  </code></pre>