public class BankAccount
extends java.lang.Object
| Constructor and Description |
|---|
BankAccount(java.lang.String acctNum,
double initialBalance)
Creates a bank account with a user-specified account number and balance
|
| Modifier and Type | Method and Description |
|---|---|
void |
deposit(double amount)
Deposits money into the bank account.
|
java.lang.String |
getAccountNumber()
Gets the account number of this bank account.
|
double |
getBalance()
Gets the current balance of the bank account.
|
void |
withdraw(double amount)
Withdraws money from the bank account.
|
public BankAccount(java.lang.String acctNum,
double initialBalance)
acctNum - the account numberinitialBalance - the initial balancepublic java.lang.String getAccountNumber()
public double getBalance()
public void deposit(double amount)
amount - the amount to depositpublic void withdraw(double amount)
amount - the amount to withdraw