title: Move all elements of an array to the right
body: <p>So ive got an array of size 22, that reads in a number from the console and adds the number to the array. so if 123456 is read in the array will print out</p>
  
  <p>12345600000000... something along those lines. </p>
  
  <p>I need to right justify this number to perform arithmetic operations, but i cant seem to get the loop structure right to output the number! </p>
  
  <pre><code>int[] newlong = new int[22];
  String inputline = "";
  
  public void readNewLong()
  {
      Scanner in = new Scanner(System.in);
      inputline = in.nextLine();
  
      try
      {
           for (int i = 0; i &lt; inputline.length(); i ++)
           {
                char a = inputline.charAt(i);
                String b = "" + a;
                newlong[i] = Integer.parseInt(b);
           }
  
      }
      catch (NumberFormatException nfe)
      {
          System.out.println("NumberFormatException, you must enter a string of digits. " + nfe.getMessage());
      }
  }
  </code></pre>
  
  <p>This is what reads in the number, inputline and store it in the array newLong.</p>
  
  <p>The method below is what is not working...</p>
  
  <pre><code>public void rightJustify()
  {
       printLong();
       System.out.println(inputline.length());
  
       for(int i = 0; i&lt; inputline.length(); i++)
       {
           for(int j = 0; j &lt; newlong.length; j++)
           {
                newlong[j] = (newlong[j] - (inputline.length() -i));
           }  
       }
       printLong();      
  }                     
  </code></pre>