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

Answer:

The two objects contain the same data: java.awt.Point[x=7,y=99]

Different Objects, Equivalent Data

two variables, two objects with equivalent data

The picture shows the situation. There are two distinct objects (each constructed out of different bytes of memory).

The equals() method returns true because the data is equivalent.


QUESTION 17:

Would the == operator do the same as the equals() method?


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