title: How can I sort this ArrayList the way that I want?
body: <p>Here is a simple sorting program of an ArrayList:</p>
  
  <pre><code>ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();
  
  list.add("1_Update");
  list.add("11_Add");
  list.add("12_Delete");
  list.add("2_Create");
  
  Collections.sort(list);
  for (String str : list) {
    System.out.println(str.toString());
  }
  </code></pre>
  
  <p>I was expecting the output of this program as:</p>
  
  <pre><code>1_Update
  2_Create
  11_Add
  12_Delete
  </code></pre>
  
  <p>But when I run this program I am getting output as:</p>
  
  <pre><code>11_Add
  12_Delete
  1_Update
  2_Create
  </code></pre>
  
  <p>Why is this and how do I get the ArrayList to sort as shown in the expected output?</p>