Menu

Public Class Point2extends Javalangobject Public Class Point2 Private Double X Private Dou Q43885772

  • public class Point2extends java.lang.Object

public class Point2 {

private double x;
       private double y;
Q1

public void set (double newX, double newY) Sets the x-coordinate and y-coordinate of this point to newx and newY, respectivel

public void moveX(double dx) Move the point in the x direction by an amount dx. The new x coordinate of the point is equal topublic void moveY (double dy) |Move the point in the y direction by an amount dy. The new y coordinate of the point is equal

public void set (double newX, double newY) Sets the x-coordinate and y-coordinate of this point to newx and newY, respectively. Parameters: newX – the new x-coordinate of this point the new y-coordinate of this point newY public void moveX(double dx) Move the point in the x direction by an amount dx. The new x coordinate of the point is equal to (this.getX() dx). + Parameters: the change in the x coordinate of this point dx public void moveY (double dy) |Move the point in the y direction by an amount dy. The new y coordinate of the point is equal to (this.getY() dy). + Parameters: dy – the change in the y coordinate of this point Show transcribed image text public void set (double newX, double newY) Sets the x-coordinate and y-coordinate of this point to newx and newY, respectively. Parameters: newX – the new x-coordinate of this point the new y-coordinate of this point newY
public void moveX(double dx) Move the point in the x direction by an amount dx. The new x coordinate of the point is equal to (this.getX() dx). + Parameters: the change in the x coordinate of this point dx
public void moveY (double dy) |Move the point in the y direction by an amount dy. The new y coordinate of the point is equal to (this.getY() dy). + Parameters: dy – the change in the y coordinate of this point

Expert Answer


Answer to public class Point2 extends java.lang.Object public class Point2 { private double x; private double y; Q1 …

OR