title: Numerically listing Arrays
body: <p>So my code is having a problem. Here's what I want to do: have one array have the original set of numbers (up to 10 numbers) and then copy and paste those numbers onto the second array. And then afterwards, the second area lists those numbers from the first array numerically (going from the lowest number to the highest). </p>
  
  <p>The problem is... my second output is giving me a good output with the lowest numbers going to the highest numbers, however, at the same time, I'm getting a long list of repeated numbers and a ton of zeros if I stop my code with the <code>-9000</code> input. Can anyone tell me what the problem is and how to fix it? I don't want to sort this second array with the Array.sort() option, by the way. No importing anything but the scanner:</p>
  
  <pre><code>public static void main(String[] args) {
  
      System.out.println("Input up to '10' numbers for current array: ");
  
      int[] array1 = new int[10];
      int i;
  
      Scanner scan = new Scanner(System.in);
  
      for (i = 0; i &lt; 10; i++) {
          System.out.println("Input a number for " + (i + 1) + ": ");
          int input = scan.nextInt();
          if (input == -9000) {
              break;
          } else {
              array1[i] = input;
          }
      }
  
      System.out.println("\n" + "Original Array: ");
  
      for (int j = 0; j &lt; i; j++) {
  
          System.out.println((j + 1) + ": " + array1[j]);
      }
  
      System.out.println("\n" + "Organized Array: ");
  
      int[] array2 = new int[i];
      for (i = 0; i &lt; array1[i]; i++) {
          System.out.println(+array1[i]);
  
          for (int j = 0; j &lt; i; j++) {
  
              int temp;
              boolean numerical = false;
  
              while (numerical == false) {
                  numerical = true;
  
                  for (i = 0; i &lt; array1.length - 1; i++) {
  
                      if (array2[i] &gt; array2[i + 1]) {
                          temp = array2[i + 1];
                          array2[i + 1] = array2[i];
                          array2[i] = temp;
                          numerical = false;
                      }
                  }
              }
  
          }
          for (i = 0; i &lt; array2.length; i++) {
              System.out.println(array2[i]);
          }
      }
  }
  </code></pre>