Object.equal Method

Determines whether the specified object is equal to the current one.

Syntax

public boolean equal(Object object)

Run On

Called

Parameters

  • object
    Type: Object Class
    The object to compare with the current object.

Return Value

Type: boolean
true if the specified object is equal to the current object; otherwise, false.

Remarks

The default implementation of the Object::equal method supports only reference equality. Derived classes can, however, override the Object::equal method to support value equality.

Examples

The following example compares the current instance with another object.

static void Object_Equal(Args _args) 
{ 
    Object objA = new Object(); 
    Object objB = new Object(); 
 
    print objA.equal(objA);  // true. 
    print objA.equal(objB);  // false. 
    objA = objB; 
    print objA.equal(objB);  // true. 
 }

See Also

Reference

Object Class