所以我试图弄清楚这个蛇游戏是如何运作的:
http://zetcode.com/tutorials/javagamestutorial/snake/
当我将代码复制到编译器中时,我在这一块代码中遇到了很多错误:
public static void main(String[] args) {
EventQueue.invokeLater(() -> {
JFrame ex = new Snake();
ex.setVisible(true);
});
}
}
以下是错误:(第 27 行是 EventQueue.invokeLater 行)
Error: illegal start of expression (Line 27)
Error: illegal start of expression (Line 27)
Error: illegal start of expression (Line 27)
Error: ';' expected (Line 27)
Error: illegal start of type (Line 30)
Error: class, interface, or enum expected (Line 32)