Java tutorial
import java.io.File; public class Main { public static void main(String[] args) { File f = new File("c:"); // true if the file path is a file, else false boolean bool = f.isFile(); // get the path String path = f.getPath(); System.out.println(path + " is file? " + bool); // create new file f = new File("c:/test.txt"); // true if the file path is a file, else false bool = f.isFile(); // get the path path = f.getPath(); System.out.print(path + " is file? " + bool); } }