title: ask the user for three names and print them in alphabetical order
body: <p>Quote for Quote from the text: "Write a program that asks the user to enter three names, and then displays the names sorted in ascending order. For example, if the user entered "Charlie","Leslie, and "Andy", the program would display </p>
  
  <pre><code>Andy 
  Charlie 
  Leslie 
  </code></pre>
  
  <p>My professor specifically said we are not allowed to use loops or arrays since we have not covered that in class. I have been trying to use the <code>compareTo</code> method but cant seem to get it to run with more than two string variables.</p>
  
  <pre><code>public class SortedNames {
  
      public static void main(String[] args) {
  
          //Declare Variables
          String name1;
          String name2;
          String name3;
  
          //Accept User Imput
          Scanner keyboard=new Scanner(System.in);
          System.out.print("Please Enter First Name ");
          name1=keyboard.nextLine();
          System.out.print("Please Enter Second Name ");
          name2=keyboard.nextLine();
          System.out.print("Please Enter Third Name ");
          name3=keyboard.nextLine();
  
  
          //Compare
  
          if((name2.compareToIgnoreCase(name1)&lt;0)&amp;&amp;(name2.compareToIgnoreCase(name3)&lt;0))
          {
              System.out.println(name2);
          }
  
          //Compare 
  
          if((name1.compareToIgnoreCase(name2)&lt;0)&amp;&amp;(name1.compareToIgnoreCase(name3)&lt;0))
          {
              System.out.println(name1);
          }
  
          //Compare
  
          if((name3.compareToIgnoreCase(name1)&lt;0)&amp;&amp;(name3.compareToIgnoreCase(name2)&lt;0))
          {
              System.out.println(name3);
          }
    }     
  
  }
  </code></pre>