Mega Code Archive

 
Categories / Java Tutorial / File
 

The File Class

A File object represents a file or directory pathname. You can pass an absolute path to a file or directory like this: File file1 = new File ("C:\\temp\\myNote.txt"); // in Windows File file2 = new File ("/tmp/myNote.txt"); // in Linux/Unix