我的代码是这样的,但是我遇到了未售出的问题。我不想为 lotNumber 输入一个 int,因为我想显示所有未售出的批次。
我哪里做错了?
public ArrayList<Lot> getUnsold()
{
for(Lot lot : lots)
{
Bid highestBid = lot.getHighestBid();
lotNumber = lot.getNumber();
Unsold = new ArrayList<Lot>();
if (highestBid != null)
{
System.out.println("Lot number " + lotNumber + " is sold"); //retuern "Sold" is highestBid
}
else
{
System.out.println(lotNumber); //print bidder and highest bid value
}
}
return Unsold;
}