While java.io.RandomAccessFile does have a close() method java.io.File doesn\'t. Why is that? Is the file closed automatically on fina
java.io.RandomAccessFile
close()
java.io.File
Say suppose, you have
File f = new File("SomeFile"); f.length();
You need not close the Files, because its just the representation of a path.
File
You should always consider to close only reader/writers and in fact streams.