Files over File有哪些优点或主要功能?何时选择一个&为什么?
修改:这只是'之间的另一个区别。在我们的世界中的问题 - 所以请确保你真的想要投票!
答案 0 :(得分:3)
答案 1 :(得分:2)
根据Java Docs,java.nio.file.Files class consists exclusively of static methods that operate on files, directories, or other types of files.
In most cases, the methods defined here will delegate to the associated file system provider to perform the file operations.
而java.io.File is an abstract representation of file and directory pathnames.