title: Java, sort strings alphabetically without arrays
body: <p>So I have another assignment to do and the task is to assort 3 strings alphabetically using the compareTo method. Basically the program receives 3 strings (a, b, and c) from a tester class and its supposed to return back the "getMin", "getMiddle", and "getMax".</p>
  
  <p>I figured out the getmin and max, seemed easy but im having problems with the getMiddle.
  this is what i have for min and max:</p>
  
  <pre><code>        String min = "";
      if (a.compareTo(b) &lt;= 0 &amp;&amp; a.compareTo(c) &lt;= 0) min = a;
      else if (b.compareTo(a) &lt;= 0 &amp;&amp; b.compareTo(c) &lt;= 0) min = b;
      else if (c.compareTo(b) &lt;= 0 &amp;&amp; c.compareTo(a) &lt;= 0) min = c;
      return min;
  </code></pre>
  
  <p>and similarly for get max only slightly different. How can I go about creating the getMiddle. Also we are not allowed to use arrays as we "haven't learned" them yet. and the prof said that the code for get middle should be around 5-6 lines.</p>
  
  <p>Thanks</p>