Question: IN JAVA------------------- Consider the class Point2D below that represents a point in a 2 dimensional environment. public class Point2D { private int x; private int

IN JAVA-------------------

Consider the class Point2D below that represents a point in a 2 dimensional environment.

public class Point2D {

private int x;

private int y;

public int getX() { return x; }

public int getY() { return y; }

public void setX(int newX) { x = newX; }

public void setY(int newY) { x = newY; }

}

Use Point2D to design and implement a class called Triangle23to represent a triangle. In Triangle23,

(1) add an equals method with the following signature to compare two triangle objects

public boolean equals(Object anotherObject)

MAIN AND TEST METHODS AREN"T NEEDED

Note: You can modify Point2D2310 to add methods that you may need.

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!