title: Simple Number to Array with Individual Digits
body: <p>I am exceptionally new to programming, but I am working on improving my skills as a programmer. Currently, I am working on a problem I gave myself where I am trying to take a variable number and make each of its digits a separate number in an array. I don't care about the order of the digits, so if they are reversed, then it doesn't matter to me. I know people have asked this question numerous times, but they always seem to use a lot of things that I don't understand. Since my school doesn't offer any Java courses, I only know what I have learned on my own, so if you could explain any terms you use in the code that aren't extremely trivial, that would be wonderful. Right now, I have written:</p>
  
  <pre><code>int number = 1234567890;
      while (number &gt; 0) {
          System.out.println(number%10);
          number = number/10; 
  </code></pre>
  
  <p>This works fine for printing the digits individually, but I can't figure out how to add them to the array. I greatly appreciate any help you can give, and please keep in mind that I much prefer simplicity over small size. Thank you in advance!</p>
  
  <p>P.S. Some responses I've seen for similar questions include what I think are arrays of strings. In order for the part of the program that I have working to still work, I think that I need to use an array of integers. If you're curious, the rest of the code is used to determine if the numbers in the array are all different, in order to achieve the final result of determining if a number's digits are all distinct. It looks like this:</p>
  
  <pre><code>int repeats=0;
  int[] digitArray;
  digitArray = new int[10];
  for (int i = 0; i &lt; digitArray.length; i++) 
      for (int j = 0; j &lt; digitArray.length; j++)
          if ((i != j) &amp;&amp; (digitArray[i]==digitArray[j])) unique = unique+1;
  System.out.println(unique==0);
  </code></pre>