编java遇到如下几个报错:

1.the declared package“”does not match the expected package “xxbb”
2.the public type StuScore must be defined in its own file
3.Syntax error,insert“)”to complete ClassBody
分别是什么意思?怎么解决?

img

截图看下你的代码
1.声明的包“”与预期的包“xxbb”不匹配
2.公共类型StuScore必须在自己的文件中定义
3.语法错误,插入")"来完成ClassBody

包名不正确

引用类的包没导入,

语法错误!

估计你是用简单的ide来编写的java,编辑器没有提醒你哪里错误,只有在编译的时候出现了错误提示!

所以,你不妨用有提示的编辑器,比如idea,eclipse