This is complicated, but I will do my best to explain my question. Object customer from the Customer class has a arraylist inside the object that store different account numbers. And all of the customer objects are stored in a arraylist. So my problem and question is how to get the account numbers from the arraylist, customerAccountsList, inside the object customer that is inside the arraylist customerList!?
With some help from previous questions here I have learned how to get values from objects inside an arraylist like this:
customerList.get(index).getAccountOwnername();
But now I'm looking for something like this:
customerList.get(index).getAccountNumbers(????);
Help is preciated! Thanks!
EDIT:
customerList.get(index).getAccountNumbers(arraylist that holds all account numbers)
I want to either get a single account number or all account numbers that are inside the arraylist. I don't want to do it to complicated since I rather new in java programming
EDIT 2:
Inside the Customer class I have this code:
ArrayList<String> customerAccountsList = new ArrayList<String>();
Inside the main class I have this code:
// create an arraylist to store customer objects
ArrayList<Customer> customerList = new ArrayList<Customer>();
ArrayList<String> getAccountNumbers() {}which will give you an ArrayList of String objects.