title: Scanning multiple files and printing them alphabetically
body: <p>I'm reading multiple text files using Java and printing their directories and I wonder why the output is not alphabetically arranged? </p>
  
  <p><strong>Code Snippet (got it from the internet also)</strong></p>
  
  <pre><code>File dir = new File("/home/dilapitan/Desktop/xml-parsing/files/");
  File[] listOfFiles = dir.listFiles();
  for (File path : listOfFiles) {
      System.out.println(path);
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>dilapitan@NT071855:~/Desktop/xml-parsing$ java Multiple 
  /home/dilapitan/Desktop/xml-parsing/files/c.txt
  /home/dilapitan/Desktop/xml-parsing/files/b.txt
  /home/dilapitan/Desktop/xml-parsing/files/a.txt
  dilapitan@NT071855:~/Desktop/xml-parsing$ 
  </code></pre>
  
  <p>Can I do it with the output being:</p>
  
  <pre><code>a.txt
  b.txt
  c.txt
  </code></pre>
  
  <p>Thank you in advance!</p>