title: How can I move a point and print the new position?
body: <p>I'm new to Java and I received an assignment that asks me to write a class called <code>PointerTester</code> that has two Points as instance variables. I need to initialize one of these at coordinate (0.0,0.0) and one at (10.0,12.0). Then I need to move each point by +2.0 in x and -3.0 in Y, query the coordinates of the points, and print out the values.</p>
  
  <p>So far I have this:</p>
  
  <pre><code>public class PointerTester{
  /*instance variables*/
      private double pointOneX;
      private double pointOneY;
      private double pointTwoX;
      private double pointTwoY;
      private double deltaX;
      private double deltaY;
  
      /*constructor to initialize*/
      public PointerTester (){
          pointOneX = 0.0;
          pointOneY = 0.0;
          pointTwoX = 10.0;
          pointTwoY = 12.0;
          deltaX = 2.0;
          deltaY = -3.0;
      }
  
      /*constructor to initialize to specific value*/
      PointerTester(double pointOneX, double pointOneY, double pointTwoX, double pointTwoY){
          this.pointOneX = pointOneX;
          this.pointOneY = pointOneY;
          this.pointTwoX = pointTwoX;
          this.pointTwoY = pointTwoY;
      }
  
      /*command to change value*/
      public void moveBy(double deltaX, double deltaY){
          this.pointOneX = this.pointOneX + deltaX;
          this.pointOneY = this.pointOneY + deltaY;
          this.pointTwoX = this.pointTwoX + deltaX;
          this.pointTwoY = this.pointTwoY + deltaY;
      }
  
      /*Queries*/
      public double getOneX(){
          return pointOneX;
      }
      public double getOneY(){
          return pointOneY;
      }
      public double getTwoX(){
          return pointTwoX;
      }
      public double getTwoY(){
          return pointTwoY;
      }
      /*print values*/
      public static void main(String[] args){
          PointerTester pointOne = new PointerTester();
          PointerTester pointTwo = new PointerTester();
          System.out.println("Point One after move (" + pointOne + ")");
          System.out.println("Point Two after move (" + pointTwo + ")");
      }
  }
  </code></pre>
  
  <p>I cannot figure out how to correctly output the values or if I am completely wrong in working on this problem.</p>
  
  <p><strong>Edit</strong> It seems I needed to use this code that I at first thought was supposed to be separate</p>
  
  <pre><code>public class Point{
      public double x;
      public double y;
  
  
      public Point(double x, double y){
          this.x = x;
          this.y = y;
      }
      public void setX(double x){
          this.x = x;
      }
      public void setY(double y){
          this.y = y;
      }
      public double getX(){
          return x;
      }
      public double getY(){
          return y;
      }
  }
  </code></pre>
  
  <p>How do I incorporate this into my code?</p>