title: Java Alphabetizing Strings
body: <p>I have a project for class were I need to get 4 different strings inputted and then output them in alphabetical order.</p>
  
  <p>So far I have this:</p>
  
  <pre><code>String wd1, wd2, wd3, wd4;
      Scanner scan1 = new Scanner(System.in);
  
      System.out.println ("Type Word One: ");
      wd1 = scan1.next();
  
      System.out.println ("Type Word Two: ");
      wd2 = scan1.next();
  
      System.out.println ("Type Word Three: ");
      wd3 = scan1.next();
  
      System.out.println ("Type Word Four: ");
      wd4 = scan1.next();
  </code></pre>
  
  <p>I know that I can get the alphabetical order of 2 strings by using:</p>
  
  <pre><code>int compare = wd1.compareTo(wd2);
  
  
      if (compare &lt; 0)
      {System.out.println(wd1 + " " + wd2);}
      else {
          if (compare &gt; 0)
          {System.out.println(wd2+ " " + wd1);}
  </code></pre>
  
  <p>I need help getting all 4 of the strings in the proper order. <strong>I am supposed to be using if else statements and not arrays to do this.</strong></p>
  
  <p>Any help would be great!</p>
  
  <p>Thanks</p>