Java: Path vs File

后端 未结 7 1114
隐瞒了意图╮
隐瞒了意图╮ 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:39

    Java.io.File is not deprecated. Yes java.nio.file.Path is better, but as long as there are still plenty of programs and text books using Java.io.File, if only for legacy reasons, it should not be considered deprecated, its too important. Doing so would just be throwing a spanner in the works for no over all gain. For example the Android framework uses File for some of its basic file handling features, many other things do to.

提交回复
热议问题