Question
create an array that can hold two BankAccount objects. In this array, add the following BankAccount objects to it: Account Number Name 123456 Sandra Murphy 789465 John Browne
So far ive created an array of object arrays which seems ok
BankAccount [] bankAccountArray = new BankAccount [2]; BankAccount bankAccount1 = new BankAccount("123456","Sandra Murphy"); BankAccount bankAccount2 = new BankAccount("789456","John Browne"); bankAccountArray[0] = bankAccount1; bankAccountArray[1] = bankAccount2;
What i need to do now is
Display the two bank accounts (objects) on the screen. You must use a loop here to display the data. If you can, try placing this code in a method and call the method to display the bank accounts.
When i use the bankAccount1.length it just says cannot find variable length. I have no idea what to do next
Anyone any suggestions?
Thanks in advance.