Hello Dear!
Hope You All are doing Fine. i have querry. i am trying to make a program of Bank Account Details with classes and OBjects. i have put change name, change typ, dopist, withdraw options. now i want to see teh history. what name it was before the change, and how much amount was deposited and what amount was withdrawn. i am unable to make a logic. can you guys help me out!

This is the output of Program....

         Welcome to XXXX Bank of Hing Hong 

         1. Details of Mr. AGHJ
         2. Details of Mr. TYUII
         3. Details of Mr. QTYUII
         4. Exit

         Enter Your Choice : 

     Welcome Mr. AGHJ In Customer Profile Page

    Account Name : AGHJ      Account Type : Saving

         1 .  Change Account Name
         2 .  Change Account Type 
         3 .  Display Account Number
         4 .  Current Balance
         5 .  WithDraw Amount
         6 .  Deposit Amount
         7 .  Recent History 
         0 .  Back

        Enter Your Choice : 

What you can do to keep a history of the names:
add an instance variable ( a list of names) and each time you call the changeName method, do something like this:

private List<String> previousNames = new ArrayList<String>();
private String name;

// ...

public void changeName(String newName){
  this.previousNames.add(this.name);
  this.name = newName;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.