This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Posted by Chin Loong on September 25, 2001 at 1:13 AM
> import java.io.*;
> public class CheckFile
> public static void main(String args)
> File f = new File("data.txt");
> System.out.println(f.getName() + " exists");
> ("The file is " + f.length() + "bytes long");
> System.out.println(" ok to read");
> System.out.println(" ok to write");
> System.out.println("File does not exit");
> In the above is the data type of f File?
> Is File a class?
> new File creates an instance of the File class. This instance is the object data.txt, am i correct?
> f.exists, f.getName etc they are methods arent they?
u answered all your questions