title: Question about adding three digits with each other in java
body: <p>I have a task to add each numbers. One of my colleague helped me out and here's the code.</p>
  
  <pre><code>public class Solution {
      public static void main(String[] args) {
          System.out.println(sumDigitsInNumber(546));
      }
  
      public static int sumDigitsInNumber(int number) {
          int sum = 0;
  
          sum = sum + number%10;
          number = number/10;
  
          sum = sum + number%10;
          number = number/10;
  
          sum = sum + number%10;
          number = number/10;
  
          return sum;//write your code here
      }
  </code></pre>
  
  <p>I'm not sure exactly how this works. Can someone please explain to me? Thanks.</p>