title: Java - Sort Array List with Objects Alphabetically and Numerically
body: <p>Im reading Classroom names ("B106") from a text file and saving them on a Array list.
  I need to sort that Array by letter and then by number.
  I read something about using Collections / Comparator but I wasnt able to implement them sucessfully, how can I do this?</p>
  
  <p>Ex:
  Input:
  "B106", "D111", "A201", "B102"</p>
  
  <p>Output:
  "A201", "B102", "B106", "D111"</p>
  
  <p>Class Core_Salas where I manage my files</p>
  
  <pre><code>public class Core_Sala {
  
  //---------------------------------------------------------------------------
  public static ArrayList&lt;Sala&gt; Sala = new ArrayList&lt;Sala&gt;();
  private static File SF = new File("Salas.txt");
  public static void LerSalas()
  {
  
      try
      {
          if(SF.exists()==true)
          {
              String[]parts;
              Sala.clear();//Array list limpar
              Scanner inputFile = new Scanner(SF);
              while (inputFile.hasNextLine()) {
                  String line = inputFile.nextLine();
                  Sala s1 = new Sala(line);
                  Sala.add(s1);
              }
              inputFile.close();
          }
      } catch (FileNotFoundException e) 
      {
          e.printStackTrace();
      }
      if(SF.exists()==false)
      {
          PrintWriter out = null;
          try
          {
              out = new PrintWriter(SF);
  
          }catch (FileNotFoundException e) {
              JOptionPane.showMessageDialog(null, "O ficheiro de utilizadores estava danificado ou era inexistente, foi criado um novo com o utilizador admin!");
          }
          out.close();
      }
  }
  }
  </code></pre>
  
  <p>Class Sala with getter Setter and Constructor</p>
  
  <pre><code>public class Sala {
  private String Salas;
  
  public Sala(String salas)
  {
      this.Salas=salas;
  }
  public String getSalas() {
      return Salas;
  }
  public void setSalas(String salas) {
      Salas = salas;
  }
  
  @Override
  public String toString()
  {
      return Salas;
  }
  }
  </code></pre>