Исправлен порядок следования параметров и удален лишний мусор
import java.util.Arrays;
class Student {
public String name;
public int[] marksum;
public Student(String name, int[] marksum) {
this.name = name;
this.marksum = marksum;
}
public double srball() {
return marksum.length == 0 ? 0.0 : (double) Arrays.stream(marksum).sum() / marksum.length;
}
}
public class Main {
public static void main(String[] args) {
int[] marksum = {2, 3, 4, 5, 6};
Student student = new Student("John", marksum);
System.out.println(student.srball());
}
}
public String name;
public int[] marksum;
public void Student(int[] marksum,String name) {
this.name = name;
this.marksum = marksum;
}
public double srball(int[] marksum, int callvo){
double summ = 0;
int srball = 0;
for (int i = 0; i < marksum.length ; i++) {
summ = summ + marksum[i];
}
return (double) summ / marksum.length;
}
public Student (int[] marksum,String name) {
this.name = name;
this.marksum = marksum;
}
public void main(String[] args){
int[] marksum = {2,3,4,5,6,};
Student student = new Student(marksum);
double srball = student.srball();
System.out.println(srball);
}
}