title: Sorting alphabetically without sort method
body: <p>Is their another way to sort a list of names that the user inputs individually in the output box other than the "Collections.Sort(list) method?</p>
  
  <pre><code>import java.util.*;
  
  public class UserInput 
  {
  public static void main(String[] args) {
  List&lt;String&gt; list = new ArrayList&lt;String&gt;();
  Scanner stdin = new Scanner(System.in);
  
  do {
      System.out.println("Enter a name: ");
      String strin = stdin.next();
      if (isNumeric(strin)) {
          System.out.println("Please add a non numeric value");
      } else {
          list.add(strin);
      }
  
      Collections.sort(list);
      System.out.println("Current list is " + list);
      System.out.println("Add more? (y/n)");
  
  } while (stdin.next().startsWith("y"));
  
  System.out.println("List is " + list);
  String[] arr = list.toArray(new String[0]);
  System.out.println("Array is " + Arrays.toString(arr));
  }
  
  public static boolean isNumeric(String str) {
  return str.matches("-?\\d+(\\.\\d+)?");
  }
  }
  </code></pre>