Microsoft SDK for Java

compare

This method of the StringComparison Class compares the two objects.

Syntax

public int compare(Object p, Object q);

Return Value

Returns the result of the comparison.

Parameters

p The first operand of the comparison.
q The second operand of the comparison.

Remarks

If both objects are instances of the String class, String.compareTo is called. If neither object is a String object, zero is returned. If one of the objects is a String, it is treated as lexicographically preceding the non-String object. This method must be addressed as ascend.compare or decend.compare.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.