@@ -21,7 +21,11 @@ public class BankAccount extends Account implements Transactable{
public void deposit(Double amountToIncreaseBy) {
- balance += amountToIncreaseBy;
+ if(amountToIncreaseBy >= 0) {
+ balance += amountToIncreaseBy;
+ } else {
+ throw new IllegalArgumentException();
+ }
}
public void withdrawal(Double amountToDecreaseBy) {