required: double [] found: no arguments

前端 未结 4 901
自闭症患者
自闭症患者 2021-01-14 20:38

Code:

 ArrayList  marks = new ArrayList();

 String output = \"Class average:\" + calculateAverage() + \"\\n\" + \"Maximum mark:\" +  
 calcu         


        
4条回答
  •  滥情空心
    2021-01-14 20:46

    You're calling the method calculateAverage this way: calculateAverage(), without any argument. But the method is declared this way:

    private double calculateAverage(double [] marks) 
    

    It thus needs one argument of type double[], but you don't pass anything.

提交回复
热议问题