Discuss / Java / eclipse如何使用record,已经Use ‘--release’ option 和 Enable preview features for Java 14了。

eclipse如何使用record,已经Use ‘--release’ option 和 Enable preview features for Java 14了。

Topic source

苏客3719

#1 Created at ... [Delete] [Delete and Lock User]

Multiple markers at this line

- Line breakpoint:Point [line: 10] - Point(int, int)

- You are using a preview language feature that may or may not be supported in a future 

release

- The public type Point must be defined in its own file

苏客3719

#2 Created at ... [Delete] [Delete and Lock User]

不好意思,我的record Point前面的public没有去掉。

TO

#3 Created at ... [Delete] [Delete and Lock User]

请问为什么这里的public 会报错??

Ives

#4 Created at ... [Delete] [Delete and Lock User]

一个文件只能有一个public class


  • 1

Reply