|
|
Comparing and copying objects via references | This page introduces three types of equality: reference equality, shallow equality, and deep equality.
A similar categorization is used for copying.
|
Do we compare references or the referenced objects? Do we copy the reference or the referenced object? How deep do we copy objects that reference other objects? |
|
|
An assignment of the form var = obj1 copies a reference A comparison of the form obj1 == obj2 compares references (unless overloaded) |