title: Do I have to make getter setters for each element of an array?
body: <p>My array is an array of objects. I only have one getter which returns the whole array.  However, if I want to modify the fields of the array elements in another class, I cannot do it through the array getter. The only solutions so far I have found is to either not leave the array field private or make getter/setter methods for each element of the array. Is there a better way to do this?</p>
  
  <p>For context, the the array is an array of Points. each point has a x coordinate and y coordinate</p>
  
  <p>when I do <code>Line.getPoints().getX()</code>, for example, it doesn't work.
  <code>Line.points[1].getX()</code> works but only if don't keep the array private.</p>