IDE 中使用 record 关键字报错
Topic source同问,我的是jdk15,并且已经打开了设置里的enable preview features for jdk15。
错误代码为:
public record Point(int x,int y) { }
错误信息是:
record 无法解析为类型
- 'record' is not a valid type name; it is a
restricted identifier and not allowed as a type identifier
in Java 15
- 1
庭除闲步
我在 idea 中使用 record 定义记录类时,提示错误,无法编译,我已经升级了 jdk 到 14 版本了
这是怎么回事呢