title: How to split an Integer into an Array using Java?
body: <p>I apologise if this has already been asked before, but I was unable to find a conclusive answer after some extensive searching, so I thought I would ask here. I am a beginner to Java (to coding, in general) and was tasked with writing a program that takes a user-inputted 3 digit number, and adds those three digits. </p>
  
  <p>Note: I cannot use loops for this task, and the three digits must all be inputted at once. </p>
  
  <pre><code>String myInput;
      myInput =        
      JOptionPane.showInputDialog(null,"Hello, and welcome to the ThreeDigit program. "
      + "\nPlease input a three digit number below. \nThreeDigit will add those three numbers and     display their sum.");
      int threedigitinput;
      threedigitinput = Integer.parseInt(myInput);
  </code></pre>