Print Out PDF
Print Out PDF
class AbdulRahmanBank {
private double balance;
public AbdulRahmanBank(double
initialBalance) {
this.balance = initialBalance;
}
try {
abdulRahmanBank.deposit(500);
abdulRahmanBank.withdraw(200);
abdulRahmanBank.withdraw(2000); // This
will throw an exception
} catch (IllegalArgumentException e) {
System.out.println(e.getMessage());
}
}
}