Question: public class Point2 extends java.lang.Object public class Point2 { private double x; private double y; Q1 public void set (double newX, double newY) Sets the

  • public class Point2 extends java.lang.Object

public class Point2 {

private double x; private double y; Q1

 public class Point2 extends 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,

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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!