Consider the class Point2D2310 below that represents a point in a 2 dimensional environment.   public class Point2D2310 {    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 Point2D2310 to design and implement a class called Triangle2310 to represent a triangle. In Triangle2310,   (1) add an equals method with the following signature to compare two triangle objects public boolean equals(Object anotherObject)     Note: You can modify Point2D2310 to add methods that you may need.   Submission instructions   1. Copy and paste your code in Triangle2310.java in the provided textbox.  2. Copy and paste your code in Point2D2310.java in the provided textbox as well, if you have modified this class. Do not copy this class if you have not modified it.  3. Your code should compile and run without any errors. 4. main and test methods should not be submitted and not needed.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 19RQ
icon
Related questions
Question

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

 

public class Point2D2310 {

   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 Point2D2310 to design and implement a class called Triangle2310 to represent a triangle. In Triangle2310,  

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

public boolean equals(Object anotherObject)

 

 

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

 

Submission instructions

 

1. Copy and paste your code in Triangle2310.java in the provided textbox. 

2. Copy and paste your code in Point2D2310.java in the provided textbox as well, if you have modified this class. Do not copy this class if you have not modified it. 

3. Your code should compile and run without any errors.

4. main and test methods should not be submitted and not needed.

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Developing computer interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,