title: Getting and setting an arraylist that's been declared in the main?
body: <p>Okay, so I have an arraylist declared in my main because elsewhere it brings up an error. However, I want to use that arraylist later specifically to have a getter, but it doesn't recognize the arraylist because it is in my main. </p>
  
  <p>The error is</p>
  
  <blockquote>
    <p>"it cannot be resolved to a variable"</p>
  </blockquote>
  
  <p>. </p>
  
  <p>What can I do to correct this? </p>
  
  <pre><code>public static void main(String[] args) {
      ArrayList &lt;String&gt; Strings = new ArrayList &lt;String&gt;(); 
          Strings.add("hi");
          Strings.add("hello");
          Strings.add("goodbye");
  }
  
  public ArrayList&lt;String&gt; getArrList() {
          return Strings;
      }
  </code></pre>