title: Should I provide a setter for a list object in Java?
body: <p>I've got a class with a list object like this:</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.List;
  
  public class MyClass
  {
      private List&lt;String&gt; myList;
  
      //???
  }
  </code></pre>
  
  <p>Now, to let other classes access the list, I'll have to add one of the following:</p>
  
  <ul>
  <li><p>a getter and a setter</p></li>
  <li><p><em>or</em> a getter and a setter and initialize the list in the constructor with an empty ArrayList</p></li>
  <li><p><em>or</em> a getter and a setter and initialize the list in the constructor with a list passed on the constructor arguments</p></li>
  <li><p><em>or</em> a getter and a setter with both constructors</p></li>
  <li><p><em>or</em> only a getter and initialize the list in the constructor with an empty ArrayList</p></li>
  <li><p><em>or</em> only a getter and initialize the list in the constructor with a list passed on the constructor arguments</p></li>
  <li><p><em>or</em> only a getter with both constructors</p></li>
  </ul>
  
  <p>What is the best thing to do? Are there conventions?</p>
  
  <p><strong>EDIT</strong>: By "letting other classes access the list" I mean nothing specific, just general usage, letting other classes work with the list, store and read objects in it.</p>