我目前正在上一门课程,显然在视频中可以使用Point类的语法,但是在我的末尾却没有。 请问为什么不能在我的IDE上运行?这是代码:
import java.awt.*;
public class Main {
public static void main(String[] args) {
Point point1 = new Point (x:1, y:1);
Point point2 = point1;
point1.x = 2;
System.out.println(point2);
}
}
他们使用的想法是插入文本中实际不存在的符号。该代码实际上是
Where the ide is inserting the
x
andy
labels. See also, Inlay Hints in IntelliJ.