Represents the method that compares two objects.