JAVA编程错误修改
publicclassMyExan7_1{classFinalClass{finalStringLanguage="JAVA";intSCORE;publicFinalC...
public class MyExan7_1{
class FinalClass{
final String Language="JAVA";
int SCORE;
public FinalClass(int s){
SCORE=s;
}
public void print(){
System.out.println(Language+"成绩是:"+SCORE+"分");
}
public static void main(String[]a){
FinalClass fc=new FinalClass(85);
fc.SCORE=18;
fc.print();
}
}
} 展开
class FinalClass{
final String Language="JAVA";
int SCORE;
public FinalClass(int s){
SCORE=s;
}
public void print(){
System.out.println(Language+"成绩是:"+SCORE+"分");
}
public static void main(String[]a){
FinalClass fc=new FinalClass(85);
fc.SCORE=18;
fc.print();
}
}
} 展开
2个回答
2014-04-30 · 知道合伙人数码行家
关注
展开全部
public class MyExan7_1{
class FinalClass{
final String Language="JAVA";
int SCORE;
public FinalClass(int s){
SCORE=s;
}
public void print(){
System.out.println(Language+"成绩是:"+SCORE+"分");
}
}
//main方法不能放到内部类里面 或者类前面加static
public static void main(String[]a){
FinalClass fc=new FinalClass(85);
fc.SCORE=18;
fc.print();
}
}
展开全部
finalClass 前面加个static
public class MyExan7_1{
static class FinalClass{
final String Language="JAVA";
int SCORE;
public FinalClass(int s){
SCORE=s;
}
public void print(){
System.out.println(Language+"成绩是:"+SCORE+"分");
}
public static void main(String[]a){
FinalClass fc=new FinalClass(85);
fc.SCORE=18;
fc.print();
}
}
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询