Question: Corret the java code, public class BankAccount { private String account _ number; private double balance; private String last _ transaction _ type; private double
Corret the java code, public class BankAccount
private String accountnumber;
private double balance;
private String lasttransactiontype;
private double lasttransactionamount;
private static int accounts count ;
private static double totalbalances ;
public BankAccountString accountnumber, double balance
this accountnumber accountnumber;
this.balance balance;
this.lasttransactiontype ;
this.lasttransactionamount ;
accountscount;
totalbalances balance;
public BankAccount BankAccount other
this.accountnumber other.accountnumber;
this.balance other.balance;
this.lasttransactiontype ;
this.lasttransactionamount ;
accountscount;
totalbalances balance;
public void depositdouble amount
balance amount;
lasttransactiontype "Deposit";
lasttransactionamount amount;
totalbalances amount;
System.out.printlnAccount :;
System.out.printlnAccount number: objgetaccountnumber;
System.out.printlnAccount balance; objgetbalance;
lic static double gettotalbalances
return totalbalances;
public class TestBankAccount
public static void mainString args
BankAccount obj new BankAccount;
BankAccount obj new BankAccount ;
BankAccount obj new BankAccountobj;
objwithdraw;
objwithdraw;
Write a TestBankAccount class with a main method. In the main method do the following: Create objects of BankAccount Class: AED for the first, AED for the second. Suggest your own values for accountnumber. Create another object that is a copy of the first object. Withdraw AED from the first account, and AED from the second account. Print the account number, the balance and the last transaction of all account objects. Print the number of accounts in the bank and the total balances
The amount is not available Account :
Account number:
Account balance:
Last transaction:
Account :
Account number:
Account balance:
Last transaction:
Account :
Account number:
Account balance:
Last transaction:
Number of accounts:
Total balances:
BUILD SUCCESSFUL total time: seconds
How to remove "The amount is not available" appear
Should be
or
accounts?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
