Question: Java about object Chapter 8 practice Write a class to represent a Point (a location in a two-dimensional coordinate space). Each Point has an x
Chapter 8 practice Write a class to represent a Point (a location in a two-dimensional coordinate space). Each Point has an x and y coordinate (integers). The Point class has a public class constant named DEFAULT_COORDINATE set to 25 Create an alternate constructor that takes integer values for both coordinates. Create a default (no-arg) constructor that sets both the x and y coordinates to DEFAULT COORDINATE. Write this constructor in terms of the alternate constructor already written. Create a copy constructor. Add getters and setters for both instance variables. Add a tostring() method the creates a String representation of the format (5, 6) Add an equals method that tests if the x and y coordinates are the same in two Point objects. This equals method should have a parameter type of Object
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
