public class SavingsAccount
extends java.lang.Object
| Constructor | Description |
|---|---|
SavingsAccount(java.lang.String userId,
double startingBalance) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
equals(java.lang.Object other) |
|
double |
getBalance() |
|
java.lang.String |
getUserId() |
|
void |
withdraw(double amount) |
public SavingsAccount(java.lang.String userId,
double startingBalance)
userId - - the account ownerstartingBalance - - the initial depositpublic void withdraw(double amount)
throws InsufficientFundsException
amount - for withdrawaljava.lang.IllegalArgumentException - if the amount is negativeInsufficientFundsException - if the amount is more than balancepublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - the object to compare with the current objectpublic double getBalance()
public java.lang.String getUserId()