|
(Thought question:) Could the equals() operator be used with aliases, as in this program? A good answer might be:Yes. You have to be careful how you use the result, however. | |
Equivalence of AliasesHere is the example program (again!) with this modification:
The picture of the situation is the same as before. But now the equals() method is used. It:
The fact that the object is the same object in step 1 and step 2 does not matter. The x's that are tested are the same, and the y's that are tested are the same, so the result is true. | |
QUESTION 21:
If the " |