title: Why do I have an error for adding a variable to an ArrayList?
body: <p>I have a class like the follows:</p>
  
  <pre><code>public class Author
  {
  
     public ArrayList&lt;String&gt; quotes;
     private String name;
  
     public Author(String name)
     {
        this.name = name;
  
     }
  }
  </code></pre>
  
  <p>Now I want to add stuff to the arraylist called quotes, in another class:</p>
  
  <pre><code>public class Page 
  {
  
      Author John = new Author("John Smith");
  
      John.quotes.add("asdf"); //but this is wrong. The add() isn't recognized
  
      ...
  }
  </code></pre>
  
  <p>As you can see, I can't add variables to the ArrayList quotes from another class. How can I do this?</p>