Question: In JAVA Step 1 Define a class called Point and satisfy the following requirements: 1.Private integer fields x and y, and a unique ID. 2.Constructors

In JAVA

Step 1 Define a class called Point and satisfy the following requirements:

  • 1.Private integer fields x and y, and a unique ID.
  • 2.Constructors with non-parameter, 2-integer parameters.
  • 3.Accessors for x, y and ID, Mutators for x, y.
  • 4.Rewrite the toString method to print the basic information of a defined point object on console.
  • 5.Method called Distance(Point p) to calculate distance to another point and return the distance as a double value.
  • 6.Method called ToCircle(Point p, double radius) to evaluate whether the defined point object is dropped on the circle, inside the circle or outside the circle, where the parameter p is the center of the circle.

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!