A data item of usage OBJECT REFERENCE can be compared for equality or inequality with another data item of usage OBJECT REFERENCE or with NULL, NULLS, or SELF.
Format 4: object-reference relation condition >>-+-object-reference-identifier-1-+--+----+--+-----+-----------> +-SELF--------------------------+ '-IS-' '-NOT-' +-NULL--------------------------+ '-NULLS-------------------------' >--+-EQUAL--+----+-+--+-object-reference-identifier-2-+-------->< | '-TO-' | +-SELF--------------------------+ '-=-------------' +-NULL--------------------------+ '-NULLS-------------------------'
A comparison with SELF is allowed only in a method.
Two object-references compare equal only if the data items identify the same object.