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

后端 未结 5 2020
不知归路
不知归路 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-30 00:07

    Essentially random access file wraps input and output streams in order to manage the random access. You don't open and close a file, you open and close streams to a file.

提交回复
热议问题