More about Objects and Classes
The relational operations on primitive data are ==, >=, <=, >, <, and !=. They compare two data values, when those values' type has an ordering. For example, integers are ordered by size or magnitude. The result of a relational operation is a boolean value: either True or False. The relational operators on objects like Strings are different, and they are expressed as methods. Pay special attention to the equality method, equals().
Does pointA.equals(pointB)return the same true/false value as
pointA == pointBreturn the same true/false value as
pointB == pointA?
Notice that in the last question there is only one object, with two variables pointing to it. When the
move() operation is performed, the data in that one object is changed. So it is still true that the data referred to by one reference variable is the same as that referred to by the the other. So
equals() still reports true.
With aliases it is easy to get confused and think that there are two objects when in fact there is only one. Perhaps this is why bank robbers use aliases.
Could an object have more than two aliases?