title: Sorting numbers with user input in an array Java
body: <p>I'm a beginner at java and I have a hopefully simple question. 
  I can get the numbers in order, but only a certain amount of numbers are added to the array. When there is a number less than the smallest number, it replaces that smallest number (the previous smallest gets removed from array). What can I do so that all of the array spots can be filled in?</p>
  
  <pre><code>public class apples {
      public static void main(String[] args) {
          System.out.print("How many numbers: ");
          int num=IO.readInt();
          double array[]=new double[num];
          double temp;
          boolean fixed=false;
  
          while (fixed==false){
              fixed=true;
  
              for(int j=0; j&lt;num;j++){
                  double x = IO.readDouble();
                  array[j] = x;
  
                  for (int i = 0; i &lt; ( num - 1 ); i++) {
                      for (j = 0; j &lt; num - i - 1; j++) {
                          if (array[j] &gt; array[j+1]) {
                              temp = array[j];
                              array[j] = array[j+1];
                              array[j+1] = temp;
                              fixed=false;
                           }
                      }
                  }
  
                  System.out.println("Sorted list of integers:");
                  for (int i = 0; i &lt; num; i++) 
                      System.out.println(array[i]);
              }
          }
      }
  }
  </code></pre>