Why doesn't java.io.File have a close method?

后端 未结 5 2011
不知归路
不知归路 2020-11-29 23:53

While java.io.RandomAccessFile does have a close() method java.io.File doesn\'t. Why is that? Is the file closed automatically on fina

5条回答
  •  迷失自我
    2020-11-29 23:57

    A BufferedReader can be opened and closed but a File is never opened, it just represents a path in the filesystem.

提交回复
热议问题