我制作了这个简单的代码,它将数字相加并找到平均值。我收到标题中显示的错误消息。下面的代码是;当我的导师不能时,有人可以帮我解决错误吗?
public class MathsQuiz {
public MathsQuiz(){
int int1 = 45;
int int2 = 56;
int int3 = 34;
int int4 = 89;
int int5 = 4;
int answer = 0;
}
public int add(int int1, int int2, int int3, int int4, int int5){
int answer = ((int1 + int2 + int3 + int4)/int5);
return answer;
}
public static final void main(String[] str){
System.out.println ("MathsQuiz" + " " + answer);
MathsQuiz mq = new MathsQuiz();
}
}