Question: Create a 2 - D array of MyPoint objects. Design a class named MyPoint to represent a point. The class contains: > Two double private

Create a 2-D array of MyPoint objects.
Design a class named MyPoint to represent a point. The class contains:
> Two double private data fields named x and y that specify the coordinates of a
point.
> A pubic no-arg constructor that creates a default point (0,0).
> A pubic constructor that creates a point with specified x and y coordinates.
> Two sets of pubic get and set methods for the two private data fields.
Write a test class named Lab8 with a main method to create a 2 by 3 array filled with
points ?1 as follows:
In your main method, use a pair of nested for-loops to print the contents of the array.
Your output should appear as below:
Array[0][0]=(0.5,1.2)
Array [0][1]=(0.0,3.14)
Array 0
 Create a 2-D array of MyPoint objects. Design a class named

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!