到目前爲止的代碼:想不通這是爲什麼死代碼
@Override
public Double getNotaMedia() {
Double notaAux = 0.0;
int aux1 = this.notas.size();
int aux3 = 0;
if(!this.notas.isEmpty()){
for (int aux2 = 0; aux2 <= aux1; aux2++){
if(this.notas.get(aux2).getValorNota() >= 5.0){
notaAux += this.notas.get(aux2).getValorNota();
aux3 = aux3 + 1;
}
return notaAux.doubleValue()/aux3;
}
}
return notaAux;
}
根據月食aux2++
是死代碼,我想不通爲什麼。
不幸的是,像你一樣編輯你的問題,使代碼正確,破壞問題的原因。現在,如果有人後來回來看這個問題,他們在試圖弄清楚發生了什麼時會遇到很多問題。 StackOverflow的設計使問題和答案可能對以後研究自己問題的人有用。我打算要求你把它恢復原樣,但是阿沙哈已經這樣做了。 – ajb