How to check if a file exists in Java

Previous
Next

It is very easy to check if file exists or not in your file system. You can use java.io.File’s exists() method to check if file exists or not.

Java program :

When you run above program, you will get following output:

Previous
Next

Add Comment