Microsoft SDK for Java

compare

This method of the Comparison Interface compares two Objects.

Syntax

public int compare(Object p, Object q);

Return Value

Returns less than 0 if p is less than or comes before q, 0 if p equals q, or greater than 0 if p is greater than or comes after q.

Parameters

p The Object to compare with q.
q The Object to compare with p.

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