title: How to sort dates in a string array in Java?
body: <p>I want to create a date array and sort it. This is how I was able to do it but this is not what I required. </p>
  
  <pre><code>   java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("dd-MM-yyyy");
     java.util.Date date1 = sdf.parse("05-03-2014");
     java.util.Date date2 = sdf.parse("23-08-2014");
     java.util.Date dates[] = {date1, date2};
     java.util.Arrays.sort(dates);
     System.out.println(java.util.Arrays.toString(dates));
  </code></pre>
  
  <p>Because I have a String array "String dates[] = {"05-11-2014", "23-08-2014","05-02-2013"};"
  So I have to sort the dates in the string array. How do I change my code?</p>