title: access array from arraylist
body: <p>I have the following arraylist</p>
  
  <pre><code>ArrayList&lt;AnotherClass&gt; exmapleName = new ArrayList&lt;AnotherClass&gt;();
  // AnotherClass is a class I created, I store objects of the class in this array, the code to this doesn't matter this works.
  </code></pre>
  
  <p>Inside of exampleName I have different types of data </p>
  
  <pre><code>public AnotherClass (String someString,  int someInt, int anotherInt, int[] intArray, ArrayList&lt;Integer&gt; arrayList)
  //Header of the constructor
  </code></pre>
  
  <p>Now what I need to do is access and store arrayList[0]. But I need to do it once the object has been created so there is actually something inside arrayList.</p>
  
  <p>This is what I've tried but doesn't seem to work </p>
  
  <pre><code>    public static void main(String[] args) {
      TestClass obj = new TestClass();
      obj.read(); //reads file
      testMethod();
  </code></pre>
  
  <p>}</p>
  
  <pre><code>       public void testMethod(){
           AnotherClass test1 = exampleName.get(1);
          ArrayList&lt;Integer&gt; test2 = test1.arrayList;
          int test3 = test2.arrayList[0];
  </code></pre>
  
  <p>}
      // I broke it down into separate lines to make it more understandable </p>
  
  <p>compiler errors are as follows</p>
  
  <pre><code>cannot find symbol
                      int test3 = test2.arrayList[0];
  symbol:   variable arrayList
  location: variable test2 of type ArrayList&lt;Integer&gt;
  </code></pre>
  
  <p>1 error</p>