title: Java bubble sort help needed
body: <p>Good evening,</p>
  
  <p>My and my bud tried to figure out why the program won't bubble sort the names that we input, maybe someone could hint about it.</p>
  
  <pre><code> public static void sortDatPlane(String Ref[]){
  
  
      int n = Ref.length;
      int k = 1;
      int j = n - 2;
      int i;
  
      while(k &lt; n){
          i = 0;
          while (i &lt;= j) {
              if(notInOrder(Ref, i, i+1)){
                  swap(Ref, i, i+1);
              }
              i++;
          }
          k++;
      }
  
      for (String Ref1 : Ref) {
          System.out.println(Ref1);
      }
  
  }
  
  public static void swap(String Ref[], int i, int j){
          String temp = Ref[i];
          Ref[i] = Ref[j];
          Ref[j] = temp;
  }
  
  public static boolean notInOrder(String Ref[],int i, int j){
      return Ref[i].substring(0,1).compareTo(Ref[j].substring(0,1)) == 1;
  }
  </code></pre>