title: Difference between C: and C:/
body: <p>I was just reading some java book and making some small programs for practice, I created a small code to get information about the path I entered, and the code is:</p>
  
  <pre><code>String path = JOptionPane.showInputDialog("Enter Path to analyze");
  
  File file =  new File(path);
  
  if (file.exists())
  {
      String result = "";
      if (file.isDirectory())
      {
          result += "Path is directory\n ";
          String [] resList = file.list();
  
          for (String s : resList)
          {
              result += s + ", ";
          }
      }
      if (file.isFile())
      {
          result += "Path is a file\n";
      }
  
      JOptionPane.showMessageDialog(null, result);
  </code></pre>
  
  <p>Now in the input dialogue, when I enter <code>C:</code>, the result is <code>build, build.xml, manifest.mf, nbproject, src</code>, but when I enter C:/, it shows the complete list of directories and files in C.</p>
  
  <p>And strangely it does not happen with the D drive and other drives (i.e. the result is same for D:/ and D:), what is happening please explain?</p>
  
  <p><strong>Update</strong>
  Same happens in WPF using C#!</p>