title: Selection Sort, For Java
body: <p>I am having trouble understanding this pseudocode, and implementing it into my program. Can anybody explain it better or show me how the code would look? Thanks.</p>
  
  <pre><code>A - an array containing the list of numbers
  numItems - the number of numbers in the list
  
  for i = 0 to numItems - 1
      for  j = i+1 to numItems               
          if A[i] &gt; A[j]
              // Swap the entries
              Temp = A[i]
              A[i] = A[j]
              A[j] = Temp          
          End If    
      Next j
  Next i 
  </code></pre>