title: Java String Bubble Sorting
body: <p>I need help sorting this array in alphabetical order using the bubble sort algorithm.</p>
  
  <p>My code is:</p>
  
  <pre><code>public class Strings
  {
      public static void main(String[] args)
      {
          Scanner reader = new Scanner(System.in);
          String tempStr;
  
  
          System.out.print("Enter the strings &gt; ");
          String s1 = new String(reader.nextLine());
  
          String[] t1 = s1.split(", ");
  
          for (int t=0; t&lt;t1.length-1; t++)
          {
             for (int i = 0; i&lt;t1.length -1; i++)
             {
                 if(t1[i+1].compareTo(t1[1+1])&gt;0)
                 {
                     tempStr = t1[i];
                     t1[i] = t1[i+1];
                     t1[i+1] = tempStr;
                  }
              }
  
          }
  
          for(int i=0;i&lt;t1.length;i++)
          {
              System.out.println(t1[i]);
          }
      }
  }
  </code></pre>
  
  <p>The code compiles, but it does not sort alphabetical. Please help me.</p>