Java: Path vs File

后端 未结 7 1126
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 10:49

For new applications written in Java 7, is there any reason to use a java.io.File object any more or can we consider it deprecated?

I believe a java.nio.file.Path c

7条回答
  •  广开言路
    2020-11-27 11:40

    For new applications written in Java 7, is there any reason to use a java.io.File object any more or can we consider it deprecated?

    This is a bit like saying: "should Napoleon invade Russia, or are these Brussels sprouts really tasty?"

    As to the second part of the question, you can indeed consider it deprecated. As of January 2018, it isn't deprecated. But there's nothing to stop you considering it so. Whether that will procure you any advantage in this life or the next is impossible to say.

提交回复
热议问题