|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBankAccount
SavingsAccount
public class SavingsAccount
Constructor Summary | |
---|---|
SavingsAccount()
Creates a savings account with initial balance equal to the minimum balance and interest rate equal to 2%. |
|
SavingsAccount(double balance,
double interestRate)
Creates a savings account with the given initial balance and interest rate. |
Method Summary | |
---|---|
void |
depositInterest()
Deposits annual interest to the account according to the interest rate. |
boolean |
withdraw(double amount)
Performs the withdrawal and returns true if the balance is greater than the minimum balance, otherwise leaves balance unchanged and returns false. |
Methods inherited from class BankAccount |
---|
deposit, equals, getAccountNumber, getBalance, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SavingsAccount(double balance, double interestRate)
balance
- Initial balanceinterestRate
- Interest ratepublic SavingsAccount()
Method Detail |
---|
public void depositInterest()
public boolean withdraw(double amount)
withdraw
in class BankAccount
amount
- Withdrawal amaount
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |