title: organizing numbers in an array in Java
body: <p>Im trying to organize random numbers in an array from least to greatest.
  I came up with a loop which I thought should work but has a lot of logic errors.</p>
  
  <pre><code> for(int z=0; z&lt;=999;z++){
      for(w=1; w&lt;=999;w++){
        if(z&lt;w){
          if(numberArray[z]&lt;numberArray[w])
           temp=numberArray[w];
          }
      }
      numberArray[z]=temp;
    }
  </code></pre>
  
  <p>Can anyone tell me how to fix this or an algorithm of their own for doing this?</p>