decrement method
void
decrement()
Decrements the quantity of this item, ensuring it doesn't go below zero.
Implementation
void decrement() {
if (quantity > 0) {
quantity--;
}
}
Decrements the quantity of this item, ensuring it doesn't go below zero.
void decrement() {
if (quantity > 0) {
quantity--;
}
}