|
How do you test if two points are equivalent? (i.e., that they indicate the same location in the 2D plane?) A good answer might be:The x value and the y value of each point is the same. | |
The equals() MethodThe equals() method is defined for class Point to perform this test:
Here is an example program showing this:
| |
QUESTION 16:What will be the output of this program? (You might wish to copy-paste-and-run this program to check your answer.) Click Here after you have answered the question |