我自己写的贪吃蛇代码为什么运行不了?菜鸟问题
《我自己写的贪吃蛇代码》http://www.bc-cn.net/bbs/dispbbs.asp?boardID=8&ID=75696&page=1
我编译出如下错误
C:\Downloads>javac b.java
b.java:5: class Snake is public, should be declared in a file named Snake.java
public class Snake extends JFrame
^
Note: b.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: b.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
----------------解决方案--------------------------------------------------------
class Snake is public, should be declared in a file named Snake.java
类Snake是public 的,必须声明一个文件叫Snake.java
你把程序代码放到Snake.java里面去就可以了
----------------解决方案--------------------------------------------------------
谢谢
----------------解决方案--------------------------------------------------------