go to previous page   go to home page   go to next page hear noise

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:
object, method changes state The first program An object was constructed. The variable pt refers it.
Then, new data replaced the old data inside the same object.
object, assignment replaces old 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?


go to previous page   go to home page   go to next page