|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SavingsAccount
public class SavingsAccount
An encapsulation of a (simple) savings account at a bank
Constructor Summary | |
---|---|
SavingsAccount(java.lang.String id)
Construct a SavingsAccount object with an initial balance of 0.00. Note: A deep copy of the id is made. |
Method Summary | |
---|---|
void |
deposit(double amount)
Increase the balance of this SavingsAccount. |
double |
getBalance()
Get the current balance in this SavingsAccount. |
java.lang.String |
getID()
Get the identifier for this SavingsAccount. |
void |
withdraw(double amount)
Reduce the balance of this SavingsAccount (if there are sufficient funds) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SavingsAccount(java.lang.String id)
id
- The identifier for this SavingsAccountMethod Detail |
---|
public void deposit(double amount)
amount
- The amount of the deposit/increasepublic double getBalance()
public java.lang.String getID()
public void withdraw(double amount)
amount
- The amount of the withdrawal/reduction
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |