title: Sum of all digits for a given Positive Number
body: <p><strong>Method return should be like if entered a number, suppose 345, then output should be 3+4+5=12 --> 1+2 = 3.</strong> what i am doing wrong here? </p>
  
  <pre><code>public class DigitSum
   {
      int  Sum=0;
  
      public int compute( int MethParam )
      {
          int rem = MethParam%10; 
          Sum+=rem;        
  
          MethParam = MethParam/10; 
          if(MethParam&gt;10)
              compute(MethParam);
  
          return Sum+MethParam;  
      }
  
    public static void main(String[] args)
    {
      DigitSum ds  = new DigitSum();
      System.out.println(ds.compute(435));
    }
  }
  </code></pre>