gpt4 book ai didi

java - oracle java教程中可能有错误?

转载 作者:搜寻专家 更新时间:2023-11-01 02:47:47 25 4
gpt4 key购买 nike

来自 this Oracle Java 教程:

The asFileAttribute method accepts a Set of file permissions and constructs a file attribute that can be passed to the Path.createFile or Path.createDirectory method.

他们的意思是 Files.createFile 吗?

最佳答案

文档是正确的,但不再是最新的。

JDK7 build b129 , 抽象方法 Path.createFile存在于抽象类中 Path .在JDK 7 build b130抽象 Path 类变为 interface并且该方法已移至 Files class 中.

这是 changeset 的链接在OpenJDK 7 mercurial repository .

-public abstract class Path 
- implements FileRef, Comparable<Path>, Iterable<Path>, Watchable
+public interface Path
+ extends Comparable<Path>, Iterable<Path>, Watchable

以及指向相关 bug 的链接在 JDK 错误系统中。

关于java - oracle java教程中可能有错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18121056/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com