soliki.blogg.se

Transtype 2
Transtype 2







transtype 2 transtype 2

create a temporary string to hold the whole statement method to create a String representation of all the Private boolean checkWithdraw(double amount) to be able to withdraw the amount specified This method is used to check whether the user has sufficient funds Transactions.add(new Trans(Trans.TRANSTYPE,-amount,balance)) Tow withdraw money from bank-> Withdraw with error checking Transactions.add(new Trans(Trans.TRANSTYPE,amount,balance)) To deposit amount into bank->PRECONDITION amount must be positive Public static void setINT_RATE(double newIR) STATIC METHODS are declared once and used between all Objects Public void setOverdraftLimit(double newLimit) These are the various accessor functions: Return accountNo+": "+accountName+": "+balance Returns a string representation of the object toString() method - ALWAYS takes the form public String toString() Return accountNo = ((BankAccount)other).accountNo This is done to compare the onject passed with equals method Z.transactions = new ArrayList(transactions)

transtype 2

Transactions.add(new Trans(Trans.TRANSTYPE,bal1,bal1)) Public BankAccount(int no1, String namehere, double bal1) Transactions = new ArrayList(p.transactions) Transactions.add(new Trans(Trans.TRANSTYPE,0.0,0.0)) This is used to store the date that the account was opened on This is used to stores balance of the account This is used to Store Account Holder's Name Transactions.add(new Trans(Trans.TRANSTYPE,amount,balance)) }īankAccount s1 = new BankAccount(10, rohan", 500) "​









Transtype 2