请分析指出以下代码中存在的问题。 public class My_Average_scores { public float getAverage(String [] scores ) { if (scores==null || scores.length==0) { throw new NullPointerException(); } float sum = 0.0F; int j=scores.length; for (int i=1; i<j; i++) { sum += scores[i]; } return sum/j; }

时间:2024-02-10 09:28:13

相似题目