title: Should I use Point.x or Point.getX()?
body: <p>I have a <code>Point</code>.  I am trying to get <code>x</code> as an <code>int</code>.  If I use <code>Point.x</code>, I will get <code>x</code> as an <code>int</code>.  But I am under the impression that I should be using a getter whenever possible (<a href="https://stackoverflow.com/questions/1568091/why-use-getters-and-setters">Why use getters and setters?</a>).  The issue with <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/Point.html#getX--" rel="nofollow noreferrer"><code>Point.getX()</code></a> is that it returns a double instead of an int.</p>
  
  <p>Which is better, or is it just preference? </p>
  
  <p><code>a</code> or <code>b</code>?</p>
  
  <pre><code>Point point = new Point(5, 5);
  int a = point.x;
  int b = (int) point.getX();
  </code></pre>
  
  <p>I have read <a href="https://stackoverflow.com/questions/10221327/java-point-difference-between-getx-and-point-x">Java Point, difference between getX() and point.x</a>, but it did not really answer my question.  Or at least I did not understand the answer.</p>