The values of all the instance variables or attributes of an object determine its state. These can change. Languages use different methods for establishing an object's identity. Each object is associated with one and only one address. Note that the reverse is not always true, because of inheritance.
Some collection classes can support either, some only one.
The important thing for you to keep in mind is which one you mean. For example, test two strings for the same value. Here, we refer to the two objects testing equal as isEqual . We refer to this as two objects having the same identity. Because of multiple inheritance, the address of a base class and its associated derived class may not be the same.