BlueJ Chpt 4 - Auction Project - How to make removeLot method work after entering a new lot
- by Ellaine Ryan
Hi All
I am learning Java through BlueJ
I would like to add a removeLot method to the Auction Class in BlueJ Chpt 4. This involves also returning the lot with the given number or null if there is no such lot.
If you enter , say 5 lots and then use the remove method, this codes removes whichever lot you specify. However if you enter a new lot after using the removeLot method - an internal error message comes up regarding lotnumbering .
Any ideas?
Thanks
Elaine
public Lot removeLot(int number) {
if((number >= 1) ) {
}
Lot lot = getLot (number);
if(lot !=null) {
lots.remove(lot);
}
return lot;
}