|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBankAccount
public class BankAccount
Constructor Summary | |
---|---|
BankAccount()
Creates a bank account with initial balance of zero. |
|
BankAccount(int balance)
Creates a bank account with the given balance. |
Method Summary | |
---|---|
void |
deposit(double amount)
Deposits the given amount to the account. |
double |
getBalance()
Returns the current balance of the account. |
boolean |
withdraw(double amount)
Withdraws the given amount from the account and returns true if the resulting balance is positive. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BankAccount(int balance)
balance
- Initial balance for the accountpublic BankAccount()
Method Detail |
---|
public void deposit(double amount)
amount
- Amount of the depositpublic boolean withdraw(double amount)
amount
- Amount of the withdrawal
public double getBalance()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |