What will this second version of the program output to the monitor?

A good answer might be:

Exactly the same as the first version of it:

First values: java.awt.Point[x=12,y=45]
Final values: java.awt.Point[x=-13,y=49]

Review

You can not be sure about the internal workings of a program by inspecting its output!

You might want to review the two programs to be sure that you understand their differences:

  What it did:
The first program An object was constructed. The variable pt references it. Then, new data replaced the old data inside the same object.
The second program An object was constructed. The variable pt references it. Then, a new object was constructed with new data, and pt was changed to reference it. The first object becomes garbage.

QUESTION 15:

How do you test if two points are equivalent? (i.e., that they indicate the same location in the 2D plane?)

Click Here after you have answered the question