Question: Requirements: You are to write a class called Point - this will represent a geometric point in a Cartesian plane (but x and y should

 Requirements: You are to write a class called Point - this
will represent a geometric point in a Cartesian plane (but x and
y should be ints). Point should have the following: Data: - that

Requirements: You are to write a class called Point - this will represent a geometric point in a Cartesian plane (but x and y should be ints). Point should have the following: Data: - that hold the x-value and the y-value. They should be ints and must be private. Constructors: - A default constructor that will set the values to (2,7) - A parameterized constructor that will receive 2 ints ( x then y ) and set the data to what is received. - A copy constructor that will receive a Point. If it receives null, then it should throw new IllegalArgumentException(> ); If it is OK, the it should initialize the data (of the new instance being created) to be the same as the Point that was received. Methods: - The methods to be implemented are shown in the PointInterface.java. You can look at this file to see the requirements for the methods. - Your Point class should be defined like this: public class Point implements PointInterface When your Point.java compiles, Java will expect all methods in the interface to be implemented and will give a compiler error if they are missing. The compiler error will read "class Point is not abstract and does not implement method ". You can actually copy the PointInterface methods definitions into your Point class so it will have the comments and the method headers. If you do this, be sure to take out the; in the method headers or you will get a "missing method body" syntax error when compiling. - A toString() method and a equals(Object obj) method are automatically inherited from the Object class. So, if you do not implement them, Java will find and use the inherited ones and will not give a compiler error (but the inherited ones will give the wrong results). The Point class should have its own. tostring and .equals methods. quirements: You are to write a class called Point - this will represent a geometric point in a Cartesian (but x and y should be ints). Point should have the following: Data: - that hold the x-value and the y-value. They should be ints and must be private. Constructors: - A default constructor that will set the values to (2,7) - A parameterized constructor that will receive 2 ints ( x then y ) and set the data to what is received. - A copy constructor that will receive a Point. If it receives null, then it should throw new IllegalArgumentException(c"your meaningful String here"); If it is OK, the it should initialize the data (of the new instance being created) to be the same as the Point that was received. Methods: - The methods to be implemented are shown in the Pointinterface,java. You can look at this file to see the requirements for the methods. Your Point class should be defined like this: public class Point implements PointInterface When your Point.java compiles, Java will expect all methods in the interface to be implemented and will give a compiler error if they are missing. The compiler error will read "class Point is not abstract and does not implement method \&the missing method"". You can actually copy the Pointinterface methods definitions into your Point class so it will have the comments and the method headers. If you do this, be sure to take out the; in the method headers or you will get a "missing method body" syntax error when compiling. - A tostring O method and a equals(Object obj) method are automatically inherited from the Object class. So, if you do not implement them, Java will find and use the inherited ones and will not give a compiler error (but the inherited ones will give the wrong results). The Point class should have its own tostring and equals methods

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!