Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Hamish Jones   on Jul 23 In Java Category.

  
Question Answered By: Marc Anderson   on Jul 23

That's the thing. The last version of the BankAccount class has no
AccountNumber member, which makes it very hard to uniquely identify
each account.

If you can't alter the BankAccount class, then the easiest way to keep
track of where the accounts are in the list is to keep a second list
of the account numbers in the same order as the accountList. Then,
when you need to find an account in the list, you can search the
number list to get the index  you need.

Of course, adding the account number  to the BankAccount class is a
better fix.

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on myArrayList.get() Or get search suggestion and latest updates.


Tagged: