title: Printing the array through each pass
body: <p>My code works fine, but I'm stuck in one part. I want to be able to print every swap, instead of printing the final sorting. Can someone help me ?</p>
  
  <pre><code>public class SelectionSort {
  
      public static void main(String[] args) {
          int []numbers = {10,5,7,9,1,0,4,6,11,14};
           numSort(numbers);
           printArray(numbers);
      }
      public static int[] numSort(int[] A) {
          for (int i = 0; i &lt;A.length -1 ; i++ ) {
              for (int j=0; j&lt;A.length-1-i; j++ ) {
                  if(A[j] &gt; A [j+1]) {
                      int temp = A[j+1];
                      A[j+1] = A[j];
                      A[j]=temp;
                  }
  
              }
          }
          return A;
      }
       public static void printArray(int[] A) {
          for (int i = 0; i&lt;A.length; i++ ) {
              System.out.println(A[i]);
          }
      }
  }
  </code></pre>