Posted on 2004-10-23
I have produced a program to replicate a bank account. The classes are as follows bank account, customer, and a TestClass which implements main. This program worked fine with input dialogs and message dialogs prompting the user. From main I declared an array of bank accounts and from the bank account class I declared a reference to the customer class.
Bank newBank = new Bank ;
newBank [noOfAccounts] = new Bank () ;
Customer newCustomer = new Customer () ;
However, I have been up for a challenge so I have decided to convert the program to Contentpanes, whilst still using the same procedure for creating bank accounts and customers. However, when I try and display the account information I now have different interest rates for the bank accounts which is as expected, but all the customer names are the same, but they all change to the last enetered customer name. To get around this I thought that I could just declare a customer array along with the bank account array, which I feel would probably get arround the problem.
The question I have is is this the correct way of doing things i.e create the customer and bank from main or should the bank account be used to create the customer. Like I said with input boxes and message boxes it all worked fine.
Any info would be much appreciated