title: How would you alphabetize words with out using array and only strings?
body: <p>Thins is what i have so far. but i need to alphabetize all four word without using arrays and only using strings with if and else statement.</p>
  
  <pre><code>    import java.util.Scanner;
  
  public class Dictionary
  {
      public static void main (String[] args)
      {
          String word1, word2, word3, word4;
          Scanner scan = new Scanner (System.in);
  
          System.out.println ("Enter Four Words: ");
          word1 = scan.next();
          word2 = scan.next();
          word3 = scan.next();
          word4 = scan.next();
  
          int compare = word1.compareTo(word2);
  
          if (compare &lt; 0)
          {System.out.println(word1 + " " + word2);}
      else if (compare &gt; 0)
          {System.out.println(word2 + " " + word1);}           
      }
  }
  </code></pre>