I have created a dirctory named test. Within this directory I have created a file named test.txt. When I execute the program below, the output for list method on cmd does not show the list of files in test directory.
Following is my code:
import java.io.*;
public class f1{
public static void main(String args[]){
try{
File f = new File("test");
System.out.println(f.exists());
System.out.println(f.isDirectory());
System.out.println(f.isFile());
System.out.println(f.list());
}
catch(Exception e){
}
}
}
Following is the output:
true
true
false
[Ljava.io.File;@15db9742