title: Get values from arraylist inside object inside arraylist in Java?
body: <p>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!?</p>
  
  <p>With some help from previous questions here I have learned how to get values from objects inside an arraylist like this:</p>
  
  <pre><code>customerList.get(index).getAccountOwnername();
  </code></pre>
  
  <p>But now I'm looking for something like this:</p>
  
  <pre><code>customerList.get(index).getAccountNumbers(????);
  </code></pre>
  
  <p>Help is preciated! Thanks!</p>
  
  <p>EDIT: </p>
  
  <pre><code>customerList.get(index).getAccountNumbers(arraylist that holds all account numbers)
  </code></pre>
  
  <p>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</p>
  
  <p>EDIT 2:</p>
  
  <p>Inside the Customer class I have this code:</p>
  
  <pre><code>ArrayList&lt;String&gt; customerAccountsList = new ArrayList&lt;String&gt;();
  </code></pre>
  
  <p>Inside the main class I have this code:</p>
  
  <pre><code>// create an arraylist to store customer objects
  ArrayList&lt;Customer&gt; customerList = new ArrayList&lt;Customer&gt;();
  </code></pre>