Question: Using java I need to: Design a class named GeoPoint to represent a point with x- and y-coordinates. The class contains: The data fields x
Using java I need to:
Design a class named GeoPoint to represent a point with x- and y-coordinates. The class contains: The data fields x and y that represent the coordinates with gette and setter methods. A no-arg constructor that creates a point (0, 0). A constructor that constructs a point with specified coordinates. The method equals(GeoPoint p) that returns true if two GeoPoint objects have the same x- and y-coordinates.
Write a test program that creates an array of GeoPoint objects. The size of the array is 3, and fill the array with three points: (2, 2), (3, 4), and (5, 5), and then print out the elements of the array.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
