How will I be able to tell if an element in the string array contains a file or a sub directory?
Each file seams to output the file name and file extension but directories seam to just have a plane name?
public static File f = new File("C:\\Users\\Matthew\\Desktop\\X\\");
String[] contents = f.list();
for(String con : contents) {
System.out.println(con);
}
//Output to console
a.txt
b.txt
Y
use isFile() and isDirctory() methods. Both has boolean as return type. So you can easily determine as per their return values.
For more information about their behaviour you can see this link