循環(huán)里面有點(diǎn)不懂呢,請(qǐng)問有人解釋下嗎
while(it.hasNext()){
items i=it.next();
sum+=i.getPrice()*goods.get(i);
}
? ?this.setTotalPrice(sum);
? ?return this.getTotalPrice();
while(it.hasNext()){
items i=it.next();
sum+=i.getPrice()*goods.get(i);
}
? ?this.setTotalPrice(sum);
? ?return this.getTotalPrice();
2018-09-05
舉報(bào)
2018-09-09
while? 當(dāng)判斷條件為true時(shí)會(huì)執(zhí)行括號(hào)內(nèi)內(nèi)容。it.hasNext()方法表示是否還有下一條記錄,是返回true,否false。