title: Sorting String[] with Dates
body: <p>I desperately try to sort an array with date e.g. "31.05.2019". I'm currently trying to do this by converting to a date type and then back. This also works. I just can't convert the string[] to Date[]. Can somebody tell me how to do it? or if necessary, give me an easier way to sort it? Unfortunately, I haven't found anything suitable online. It can also be that I'm too stupid.</p>
  
  <p>I tried to convert the String manually to Date and it works. But i tried different ways to convert String[] to Date[]. I tried with a loop.. and some other stuff... but it doesnt work..</p>
  
  <pre><code>public static void main(String[] args) throws ParseException {
      TagebuchIO io = new TagebuchIO();
      String[] stringio = io.getTagebuchliste();
      //He got the Dates with stringio
      SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyy");
  
      Date date = sdf.parse("10.05.2010");
      Date date2 = sdf.parse("09.02.2012");
      Date[] d = {date, date2};
      Arrays.sort(d);
      String ergbenis1 = sdf.format(d[0]);
      System.out.println(ergbenis1);
      ergbenis1 = sdf.format(d[1]);
      System.out.println(ergbenis1);
  }
  </code></pre>