Review

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   go to next page

Answer:

Exactly the same as the first version of it:

java.awt.Point[x=12,y=45]
java.awt.Point[x=-13,y=49]

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

Review

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

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

QUESTION 15:

When are two points equivalent?