title: Retrieving a specific value using an accessor method with an array return type
body: <p>I have an accessor method which returns an array. Here's a bit of code to give you context...</p>
  
  <pre><code>   public void setCoordinate (double x, double y) {
        this.x = x;
        this.y = y;
     }
  
     public double[] getCoordinate() {
        return new double[] {x, y};
     }
  </code></pre>
  
  <p>I want to use x and y later on, but I'm not sure how to call the getCoordinate method without retrieving both the x and y variables. I know how to call a method, but I'm not sure how to call specific value from the array using the accessor method. </p>