class HelloJava is public, should be declared in a file named HelloJava.java

编译hello_java.java时出现error:

class HelloJava is public, should be declared in a file named HelloJava.java

 

类的名字是“HelloJava”
保证类名单词首字母大写
so file name should be declared by 'HelloJava.java' 

把文件名HelloJava.java 与 类名 HelloJava 统一再编译就解决啦!

 

 

#
碎碎念「
英文废物刚开始学java感觉要扣好多细节噢!呜呜欧这就是面向百度编程吗?
#

你可能感兴趣的:(class HelloJava is public, should be declared in a file named HelloJava.java)