title: Way to access ArrayList from other method in same class without passing argument?
body: <p>I'm trying to have my method "add" access the contents of an ArrayList that was created in method "Friends", but Java isn't happy with what I'm doing (scope issues?). Is there a way to fix the problem without having to pass arguments?</p>
  
  <pre><code>public class Friends {
  public Friends(float x, float y)
      {       
          ArrayList&lt;MyObject&gt; arrayList = new ArrayList&lt;MyObject&gt;(); 
          MyObject[] friendList = new MyObject[20];
  
      }
  
  public void add()
      {       
          for (int i = 0; i &lt; 20; i++) {
              //friendList[i]
          }
      }
  }
  </code></pre>
  
  <p>note that Friends is meant to be a constructor (if I'm using that word right)</p>