What is the output of this code?

Last Updated :
Discuss
Comments

What is the output of this code?

Java
File f = new File("demo.txt");
System.out.println(f.isDirectory());

Assume demo.txt is a file, not a folder.

true

false

null

Compilation Error

Share your thoughts in the comments